Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix compatibility with Ruby 1.8 that also has the Miniunit gem instal…

…led.

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
commit 3a33ee28e9babc5a1a78079f5ca50ea6249f2643 1 parent 2ace3d9
@FooBarWidget FooBarWidget authored jeremy committed
Showing with 7 additions and 3 deletions.
  1. +7 −3 activesupport/lib/active_support/test_case.rb
View
10 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
Please sign in to comment.
Something went wrong with that request. Please try again.