Merge pull request #2823 from MikeMcQuaid/test-simplify-minitest
test: simplify minitest inclusion.
This commit is contained in:
commit
3ce667f3b9
@ -83,7 +83,7 @@ module Homebrew
|
|||||||
exec(*args)
|
exec(*args)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
rescue Assertions::FailedAssertion => e
|
rescue MiniTest::Assertion => e
|
||||||
ofail "#{f.full_name}: failed"
|
ofail "#{f.full_name}: failed"
|
||||||
puts e.message
|
puts e.message
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
|
|||||||
@ -1,26 +1,6 @@
|
|||||||
module Homebrew
|
module Homebrew
|
||||||
module Assertions
|
module Assertions
|
||||||
if defined?(Gem)
|
require "test/unit/assertions"
|
||||||
begin
|
|
||||||
gem "minitest", "< 5.0.0"
|
|
||||||
rescue Gem::LoadError
|
|
||||||
require "test/unit/assertions"
|
|
||||||
else
|
|
||||||
require "minitest/unit"
|
|
||||||
require "test/unit/assertions"
|
|
||||||
end
|
|
||||||
else
|
|
||||||
require "test/unit/assertions"
|
|
||||||
end
|
|
||||||
|
|
||||||
if defined?(MiniTest::Assertion)
|
|
||||||
FailedAssertion = MiniTest::Assertion
|
|
||||||
elsif defined?(Minitest::Assertion)
|
|
||||||
FailedAssertion = Minitest::Assertion
|
|
||||||
else
|
|
||||||
FailedAssertion = Test::Unit::AssertionFailedError
|
|
||||||
end
|
|
||||||
|
|
||||||
include ::Test::Unit::Assertions
|
include ::Test::Unit::Assertions
|
||||||
|
|
||||||
# Returns the output of running cmd, and asserts the exit status
|
# Returns the output of running cmd, and asserts the exit status
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user