From 5537abbe511b10046adc26ee821d95a977a1efb6 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Sat, 28 Sep 2013 12:21:16 -0700 Subject: Adjust fails_with syntax for non-Apple compilers The old version worked like this: fails_with :gcc => '4.8.1' That wasn't really flexible enough, and made it harder to distinguish different releases in the same GCC series. Since no one was really using it yet, this adjusts the syntax to be more similar to the Apple compilers: fails_with :gcc => '4.8' do release '4.8.1' end Like with Apple compilers, omitting `release` blacklists the entire series. This also unifies the `build` and `version` attributes and accessors, and exposes them under both names. --- Library/Homebrew/test/test_fails_with.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Library/Homebrew/test') diff --git a/Library/Homebrew/test/test_fails_with.rb b/Library/Homebrew/test/test_fails_with.rb index 31f318a4c..642d9c060 100644 --- a/Library/Homebrew/test/test_fails_with.rb +++ b/Library/Homebrew/test/test_fails_with.rb @@ -3,7 +3,7 @@ require 'test/testball' class FailsWithTests < Test::Unit::TestCase class Double < Compiler - attr_accessor :name, :build, :version + attr_accessor :name, :version end def assert_fails_with(cc) @@ -21,8 +21,7 @@ class FailsWithTests < Test::Unit::TestCase def build_cc(sym, build, version=nil) cc = Double.new cc.name = sym - cc.build = build - cc.version = version + cc.version = version || build cc end @@ -49,7 +48,7 @@ class FailsWithTests < Test::Unit::TestCase end def test_non_apple_gcc_version - fails_with(:gcc => '4.8.2') + fails_with(:gcc => '4.8') cc = build_cc("gcc-4.8", nil, "4.8.1") assert_fails_with cc end -- cgit v1.2.3