aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorJack Nagel2012-08-25 16:02:09 -0500
committerJack Nagel2012-08-25 16:03:35 -0500
commitefaec17212841c2effe8c6dc7baccd143a33a4f7 (patch)
treec90e9ba965010434b0f5813a2bd3c60156dffa75 /Library/Homebrew/test
parent246530cc4f7eeddfbb8c6381f227a6c4977b2040 (diff)
downloadhomebrew-efaec17212841c2effe8c6dc7baccd143a33a4f7.tar.bz2
tests: adjust test_bottle_spec_selection for new bottle code
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_bottles.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/Library/Homebrew/test/test_bottles.rb b/Library/Homebrew/test/test_bottles.rb
index f44302071..8f5104f36 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