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:
parent
1a487fa2b3
commit
503d781150
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user