mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Safer but hacky minitest autorun override
This commit is contained in:
@@ -4,15 +4,16 @@ require 'active_support/testing/declarative'
|
||||
|
||||
module ActiveSupport
|
||||
# Prefer MiniTest with Test::Unit compatibility.
|
||||
# Hacks around the test/unit autorun.
|
||||
begin
|
||||
require 'minitest/unit'
|
||||
|
||||
# Hack around the test/unit autorun.
|
||||
autorun_enabled = MiniTest::Unit.class_variable_get('@@installed_at_exit')
|
||||
MiniTest::Unit.disable_autorun
|
||||
require 'test/unit'
|
||||
MiniTest::Unit.class_variable_set('@@installed_at_exit', autorun_enabled)
|
||||
|
||||
class TestCase < ::Test::Unit::TestCase
|
||||
@@installed_at_exit = false
|
||||
end
|
||||
class TestCase < ::Test::Unit::TestCase; end
|
||||
|
||||
# Test::Unit compatibility.
|
||||
rescue LoadError
|
||||
|
||||
Reference in New Issue
Block a user