提交 46761b88 编写于 作者: V Vishnu Atrai

support only MiniTest run with Isolation test

上级 44951c8d
......@@ -38,11 +38,7 @@ def self.forking_env?
end
def self.included(base)
if defined?(::MiniTest) && base < ::MiniTest::Unit::TestCase
base.send :include, MiniTest
elsif defined?(Test::Unit)
base.send :include, TestUnit
end
base.send :include, MiniTest
end
def _run_class_setup # class setup method should only happen in parent
......@@ -52,30 +48,6 @@ def _run_class_setup # class setup method should only happen in parent
end
end
module TestUnit
def run(result)
_run_class_setup
yield(Test::Unit::TestCase::STARTED, name)
@_result = result
serialized = run_in_isolation do |proxy|
begin
super(proxy) { }
rescue Exception => e
proxy.add_error(Test::Unit::Error.new(name, e))
end
end
retval, proxy = Marshal.load(serialized)
proxy.__replay__(@_result)
yield(Test::Unit::TestCase::FINISHED, name)
retval
end
end
module MiniTest
def run(runner)
_run_class_setup
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册