Safer but hacky minitest autorun override

This commit is contained in:
Jeremy Kemper
2008-11-07 12:58:42 -05:00
parent 18099b0fd5
commit 70c2fcab09

View File

@@ -4,15 +4,16 @@ require 'active_support/testing/declarative'
module ActiveSupport
# Prefer MiniTest with Test::Unit compatibility.
# Hacks around the test/unit autorun.
begin
require 'minitest/unit'
# Hack around the test/unit autorun.
autorun_enabled = MiniTest::Unit.class_variable_get('@@installed_at_exit')
MiniTest::Unit.disable_autorun
require 'test/unit'
MiniTest::Unit.class_variable_set('@@installed_at_exit', autorun_enabled)
class TestCase < ::Test::Unit::TestCase
@@installed_at_exit = false
end
class TestCase < ::Test::Unit::TestCase; end
# Test::Unit compatibility.
rescue LoadError