test: simplify minitest inclusion.
The previous version seems needlessly complicated given we only support a single Ruby version. It was also blowing up on Bundler 1.15.X.
This commit is contained in:
parent
5f8a86c178
commit
c45cca8e36
@ -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