aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHongli Lai (Phusion) <hongli@phusion.nl>2008-11-17 21:28:43 +0100
committerJeremy Kemper <jeremy@bitsweat.net>2008-11-17 12:38:47 -0800
commit3a33ee28e9babc5a1a78079f5ca50ea6249f2643 (patch)
treef9e357ca29694361c7c473c17958bd4ce235c351
parent2ace3d9154aa66aab66e1f7db2a2a309d1336b8b (diff)
downloadrails-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>
-rw-r--r--activesupport/lib/active_support/test_case.rb10
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