summaryrefslogtreecommitdiff
path: root/test/testunit
diff options
context:
space:
mode:
authorsorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-24 01:08:51 +0000
committersorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-24 01:08:51 +0000
commite9c22a6f1a0b1f7afe2ca282209015e48fef5795 (patch)
tree02b93c3e6af5db45908317d6258684989dc8b976 /test/testunit
parent48fa6ed529d531419b54c56993730b0e2ded928c (diff)
* test/testunit/tests_for_parallel/misc.rb: Fix bug in r30947.
* lib/test/unit.rb, lib/test/unit/assertions.rb: For this test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/testunit')
-rw-r--r--test/testunit/tests_for_parallel/misc.rb47
1 files changed, 26 insertions, 21 deletions
diff --git a/test/testunit/tests_for_parallel/misc.rb b/test/testunit/tests_for_parallel/misc.rb
index c0fa31d..f60b25d 100644
--- a/test/testunit/tests_for_parallel/misc.rb
+++ b/test/testunit/tests_for_parallel/misc.rb
@@ -1,31 +1,36 @@
-module Test
- module Unit
- class Worker
- def run_tests
- _run_anything :ptest
+# FIXME: more portability code
+if caller(7) && /block in non_options/ =~ caller(7)[0]
+ class TestCaseForParallelTest < Test::Unit::TestCase;end
+else
+ module Test
+ module Unit
+ class Worker
+ def run_tests
+ _run_anything :ptest
+ end
end
- end
- class Runner
- def run_tests
- _run_anything :ptest
+ class Runner
+ def run_tests
+ _run_anything :ptest
+ end
end
end
end
-end
-module MiniTest
- class Unit
- class << TestCase
- alias ptest_suites test_suites
- def ptest_methods;[];end
+ module MiniTest
+ class Unit
+ class << TestCase
+ alias ptest_suites test_suites
+ def ptest_methods;[];end
+ end
end
end
-end
-class TestCaseForParallelTest < Test::Unit::TestCase
- class << self
- undef ptest_methods
- def ptest_methods
- public_instance_methods(true).grep(/^ptest/).map { |m| m.to_s }
+ class TestCaseForParallelTest < Test::Unit::TestCase
+ class << self
+ undef ptest_methods
+ def ptest_methods
+ public_instance_methods(true).grep(/^ptest/).map { |m| m.to_s }
+ end
end
end
end