diff --git a/Library/Homebrew/dev-cmd/test.rb b/Library/Homebrew/dev-cmd/test.rb index a8661179fb..c678171acb 100644 --- a/Library/Homebrew/dev-cmd/test.rb +++ b/Library/Homebrew/dev-cmd/test.rb @@ -83,7 +83,7 @@ module Homebrew exec(*args) end end - rescue MiniTest::Assertion => e + rescue ::Test::Unit::AssertionFailedError => e ofail "#{f.full_name}: failed" puts e.message rescue Exception => e diff --git a/Library/Homebrew/formula_assertions.rb b/Library/Homebrew/formula_assertions.rb index f81087a3dd..2ba5767a71 100644 --- a/Library/Homebrew/formula_assertions.rb +++ b/Library/Homebrew/formula_assertions.rb @@ -3,6 +3,11 @@ module Homebrew require "test/unit/assertions" include ::Test::Unit::Assertions + # TODO: remove this when we no longer support Ruby 2.0. + unless defined?(Test::Unit::AssertionFailedError) + Test::Unit::AssertionFailedError = MiniTest::Assertion + end + # Returns the output of running cmd, and asserts the exit status def shell_output(cmd, result = 0) ohai cmd