aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/testing_env.rb
diff options
context:
space:
mode:
authorJack Nagel2014-06-10 22:43:47 -0500
committerJack Nagel2014-06-18 20:34:09 -0500
commit06305e621199409f954b34166194e18e610d4e89 (patch)
treefdff43f2c51542f04e7e7f03786f446bbe2db02f /Library/Homebrew/test/testing_env.rb
parent89d74ec475633be7b44b10f7c3a1d9957b87b1c7 (diff)
downloadbrew-06305e621199409f954b34166194e18e610d4e89.tar.bz2
Switch to Minitest
Diffstat (limited to 'Library/Homebrew/test/testing_env.rb')
-rw-r--r--Library/Homebrew/test/testing_env.rb23
1 files changed, 10 insertions, 13 deletions
diff --git a/Library/Homebrew/test/testing_env.rb b/Library/Homebrew/test/testing_env.rb
index 76e1b19f3..25478de92 100644
--- a/Library/Homebrew/test/testing_env.rb
+++ b/Library/Homebrew/test/testing_env.rb
@@ -5,6 +5,7 @@ $:.push(File.expand_path(__FILE__+'/../..'))
require 'extend/module'
require 'extend/fileutils'
require 'extend/pathname'
+require 'extend/ARGV'
require 'extend/string'
require 'extend/symbol'
require 'extend/enumerable'
@@ -56,22 +57,14 @@ at_exit { HOMEBREW_PREFIX.parent.rmtree }
# Test fixtures and files can be found relative to this path
TEST_DIRECTORY = File.dirname(File.expand_path(__FILE__))
-require 'test/unit' # must be after at_exit
-require 'extend/ARGV' # needs to be after test/unit to avoid conflict with OptionsParser
ARGV.extend(HomebrewArgvExtension)
begin
- require 'rubygems'
- require 'mocha/setup'
+ require "rubygems"
+ require "minitest/autorun"
+ require "mocha/setup"
rescue LoadError
- warn 'The mocha gem is required to run some tests, expect failures'
-end
-
-module Test::Unit::Assertions
- def assert_empty(obj, msg=nil)
- assert_respond_to(obj, :empty?, msg)
- assert(obj.empty?, msg)
- end unless method_defined?(:assert_empty)
+ abort "Run `rake deps` or install the mocha and minitest gems before running the tests"
end
module Homebrew
@@ -97,7 +90,7 @@ module Homebrew
end
end
- class TestCase < ::Test::Unit::TestCase
+ class TestCase < ::Minitest::Test
include VersionAssertions
TEST_SHA1 = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef".freeze
@@ -120,5 +113,9 @@ module Homebrew
$stdout.reopen(out)
end
end
+
+ def assert_nothing_raised
+ yield
+ end
end
end