You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rubygem-i18n/rubygem-i18n-0.6.10-minites...

45 lines
1014 B

diff --git a/test/test_helper.rb b/test/test_helper.rb
index 53f34aa..d24b81f 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -1,7 +1,25 @@
$KCODE = 'u' if RUBY_VERSION <= '1.9'
require 'rubygems'
-require 'test/unit'
+
+# Use minitest if we can, otherwise fallback to test-unit.
+begin
+ require 'minitest/autorun'
+ TEST_CASE = defined?(Minitest::Test) ? Minitest::Test : MiniTest::Unit::TestCase
+
+ # TODO: Remove these aliases and update tests accordingly.
+ class TEST_CASE
+ alias :assert_raise :assert_raises
+ alias :assert_not_equal :refute_equal
+
+ def assert_nothing_raised(*args)
+ yield
+ end
+ end
+rescue LoadError
+ require 'test/unit'
+ TEST_CASE = Test::Unit::TestCase
+end
# Do not load the i18n gem from libraries like active_support.
#
@@ -17,7 +35,7 @@
require 'mocha'
require 'test_declarative'
-class Test::Unit::TestCase
+class I18n::TestCase < TEST_CASE
def teardown
I18n.locale = nil
I18n.default_locale = :en
--
1.9.3