From 4c438fd0febce6557ebd38b363451eeab0914d58 Mon Sep 17 00:00:00 2001 From: sorah Date: Sun, 19 Jun 2011 01:12:02 +0000 Subject: * lib/test/unit/parallel.rb: Override Test::Unit::TestCase#on_parallel_worker? only when $0 == __FILE__. * lib/test/unit/parallel.rb: Run Test::Unit::Worker.run only when $0 == __FILE__. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/test/unit/parallel.rb | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'lib/test/unit/parallel.rb') diff --git a/lib/test/unit/parallel.rb b/lib/test/unit/parallel.rb index ab9e864509..7a7c73d4f2 100644 --- a/lib/test/unit/parallel.rb +++ b/lib/test/unit/parallel.rb @@ -2,12 +2,6 @@ require 'test/unit' module Test module Unit - class TestCase < MiniTest::Unit::TestCase - def on_parallel_worker? - true - end - end - class Worker < Runner class << self undef autorun @@ -148,4 +142,16 @@ module Test end end -Test::Unit::Worker.new.run(ARGV) +if $0 == __FILE__ + module Test + module Unit + class TestCase < MiniTest::Unit::TestCase + def on_parallel_worker? + true + end + end + end + end + + Test::Unit::Worker.new.run(ARGV) +end -- cgit v1.2.3