mirror of
https://github.com/donl/homebrew-cask-versions.git
synced 2026-07-17 06:16:47 -06:00
Helps prevent default appdir from being created regardless of whether the user configured it or not. Closes #496
18 lines
382 B
Ruby
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
|