aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2017-06-25 13:04:36 +0100
committerMike McQuaid2017-06-25 13:04:36 +0100
commitc45cca8e36401f6d95d851befef35879a5629182 (patch)
tree8dba3d44aa35e4342b66651a101b3f36fcc115fc /Library
parent5f8a86c17829b9f45486af6a9d24a3aea4bae8b3 (diff)
downloadbrew-c45cca8e36401f6d95d851befef35879a5629182.tar.bz2
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.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/dev-cmd/test.rb2
-rw-r--r--Library/Homebrew/formula_assertions.rb22
2 files changed, 2 insertions, 22 deletions
diff --git a/Library/Homebrew/dev-cmd/test.rb b/Library/Homebrew/dev-cmd/test.rb
index 738a0ef29..a8661179f 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 Assertions::FailedAssertion => e
+ rescue MiniTest::Assertion => 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 047b40abc..f81087a3d 100644
--- a/Library/Homebrew/formula_assertions.rb
+++ b/Library/Homebrew/formula_assertions.rb
@@ -1,26 +1,6 @@
module Homebrew
module Assertions
- if defined?(Gem)
- 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
-
+ require "test/unit/assertions"
include ::Test::Unit::Assertions
# Returns the output of running cmd, and asserts the exit status