提交 3a33ee28 编写于 作者: H Hongli Lai (Phusion) 提交者: Jeremy Kemper

Fix compatibility with Ruby 1.8 that also has the Miniunit gem installed.

Signed-off-by: NJeremy Kemper <jeremy@bitsweat.net>
上级 2ace3d91
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册