Allow tests to reset bottle hooks on teardown

This avoids polluting other tests that might invoke the installer, thus
executing any registered hooks.
This commit is contained in:
Jack Nagel 2014-10-29 23:49:52 -05:00
parent 1a487fa2b3
commit 503d781150
2 changed files with 8 additions and 0 deletions

View File

@ -26,6 +26,10 @@ module Homebrew
return false unless @pour_bottle return false unless @pour_bottle
@pour_bottle.call formula @pour_bottle.call formula
end end
def self.reset_hooks
@has_bottle = @pour_bottle = nil
end
end end
end end
end end

View File

@ -37,4 +37,8 @@ class BottleHookTests < Homebrew::TestCase
end end
@fi.pour @fi.pour
end end
def teardown
Homebrew::Hooks::Bottles.reset_hooks
end
end end