homebrew-cask-versions/test/support/fake_appdir.rb
Keith Smiley 6404f82d09 Verify appdir after reading command line opts
Helps prevent default appdir from being created regardless of whether
the user configured it or not.

Closes #496
2013-06-15 20:13:05 -05:00

18 lines
382 B
Ruby

# wire in a fake appdir per-test
module FakeAppdirHooks
def before_setup
super
@canned_appdir = HOMEBREW_REPOSITORY/"Applications-#{Time.now.to_i}-#{rand(1024)}"
@canned_appdir.mkpath
Cask.appdir = @canned_appdir
end
def after_teardown
super
@canned_appdir.rmtree if @canned_appdir.exist?
end
end
class MiniTest::Spec
include FakeAppdirHooks
end