Merge pull request #2841 from mistydemeo/formula_assertions_constant
Define a custom assertion failure error for cross-version compat
This commit is contained in:
commit
ddb1fd7981
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user