diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-11-07 12:58:42 -0500 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-11-07 12:58:42 -0500 |
commit | 70c2fcab09334b0bdbc58e67ff3cf7f1de472112 (patch) | |
tree | 3d923d6da8526107d116dcf99987985a22d9ecef | |
parent | 18099b0fd53b8f9ba88ef46bdd910347f03c72c5 (diff) | |
download | rails-70c2fcab09334b0bdbc58e67ff3cf7f1de472112.tar.gz rails-70c2fcab09334b0bdbc58e67ff3cf7f1de472112.tar.bz2 rails-70c2fcab09334b0bdbc58e67ff3cf7f1de472112.zip |
Safer but hacky minitest autorun override
-rw-r--r-- | activesupport/lib/active_support/test_case.rb | 9 |
1 files changed, 5 insertions, 4 deletions
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 |