diff --git a/activesupport/lib/active_support/test_case.rb b/activesupport/lib/active_support/test_case.rb index f47329d026334be74cec0794a8a88af421e5d984..5b825b212de8d20463d32fbd77ab1fcfe52867b9 100644 --- a/activesupport/lib/active_support/test_case.rb +++ b/activesupport/lib/active_support/test_case.rb @@ -8,10 +8,14 @@ module ActiveSupport require 'minitest/unit' # Hack around the test/unit autorun. - autorun_enabled = MiniTest::Unit.class_variable_get('@@installed_at_exit') - MiniTest::Unit.disable_autorun + autorun_enabled = MiniTest::Unit.send(:class_variable_get, '@@installed_at_exit') + if MiniTest::Unit.respond_to?(:disable_autorun) + MiniTest::Unit.disable_autorun + else + MiniTest::Unit.send(:class_variable_set, '@@installed_at_exit', false) + end require 'test/unit' - MiniTest::Unit.class_variable_set('@@installed_at_exit', autorun_enabled) + MiniTest::Unit.send(:class_variable_set, '@@installed_at_exit', autorun_enabled) class TestCase < ::Test::Unit::TestCase Assertion = MiniTest::Assertion