diff options
author | Hongli Lai (Phusion) <hongli@phusion.nl> | 2008-11-17 21:28:43 +0100 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-11-17 12:38:47 -0800 |
commit | 3a33ee28e9babc5a1a78079f5ca50ea6249f2643 (patch) | |
tree | f9e357ca29694361c7c473c17958bd4ce235c351 /activesupport | |
parent | 2ace3d9154aa66aab66e1f7db2a2a309d1336b8b (diff) | |
download | rails-3a33ee28e9babc5a1a78079f5ca50ea6249f2643.tar.gz rails-3a33ee28e9babc5a1a78079f5ca50ea6249f2643.tar.bz2 rails-3a33ee28e9babc5a1a78079f5ca50ea6249f2643.zip |
Fix compatibility with Ruby 1.8 that also has the Miniunit gem installed.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/test_case.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/test_case.rb b/activesupport/lib/active_support/test_case.rb index f47329d026..5b825b212d 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 |