From 3a33ee28e9babc5a1a78079f5ca50ea6249f2643 Mon Sep 17 00:00:00 2001 From: "Hongli Lai (Phusion)" Date: Mon, 17 Nov 2008 21:28:43 +0100 Subject: Fix compatibility with Ruby 1.8 that also has the Miniunit gem installed. Signed-off-by: Jeremy Kemper --- activesupport/lib/active_support/test_case.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'activesupport/lib/active_support') 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 -- cgit v1.2.3