diff --git a/Library/Homebrew/test/test_bottles.rb b/Library/Homebrew/test/test_bottles.rb index f443020716..8f5104f36a 100644 --- a/Library/Homebrew/test/test_bottles.rb +++ b/Library/Homebrew/test/test_bottles.rb @@ -4,16 +4,18 @@ require 'test/testball' # We temporarily redefine bottles_supported? because the # following tests assume it is true, but other tests may # expect the real value. -def bottles_are_supported &block - alias :old_bottles_supported? :bottles_supported? - def bottles_supported?; true end - instance_eval(&block) - def bottles_supported?; old_bottles_supported? end +module MacOS extend self + def bottles_are_supported + alias :old_bottles_supported? :bottles_supported? + def bottles_supported?; true end + yield + def bottles_supported?; old_bottles_supported? end + end end class BottleTests < Test::Unit::TestCase def test_bottle_spec_selection - bottles_are_supported do + MacOS.bottles_are_supported do f = SnowLeopardBottleSpecTestBall.new assert_equal case MacOS.cat