From 70c2fcab09334b0bdbc58e67ff3cf7f1de472112 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 7 Nov 2008 12:58:42 -0500 Subject: Safer but hacky minitest autorun override --- activesupport/lib/active_support/test_case.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'activesupport/lib/active_support/test_case.rb') diff --git a/activesupport/lib/active_support/test_case.rb b/activesupport/lib/active_support/test_case.rb index be38eb64a1..b991f62a17 100644 --- a/activesupport/lib/active_support/test_case.rb +++ b/activesupport/lib/active_support/test_case.rb @@ -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 -- cgit v1.2.3