summaryrefslogtreecommitdiff
path: root/test/testunit
diff options
context:
space:
mode:
authorsorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-15 23:06:00 +0000
committersorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-15 23:06:00 +0000
commitea11cf5d7f902609912652ad74586334638b4945 (patch)
treef74a879562d46e9fad06a21a0940fc9c5c89bd29 /test/testunit
parent6e125382d7af727f70063a8f5e5959744865c193 (diff)
* test/testunit/test_parallel.rb(test_ignore_tzero): Test for r32109.
* test/testunit/tests_for_parallel/test_third.rb: Use another way to detect that test is running on worker. This fixes sometimes TestParallel failing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/testunit')
-rw-r--r--test/testunit/test_parallel.rb11
-rw-r--r--test/testunit/tests_for_parallel/test_third.rb2
2 files changed, 10 insertions, 3 deletions
diff --git a/test/testunit/test_parallel.rb b/test/testunit/test_parallel.rb
index 2f114bb..7a2e9ae 100644
--- a/test/testunit/test_parallel.rb
+++ b/test/testunit/test_parallel.rb
@@ -140,8 +140,15 @@ module TestParallel
end
end
- #def test_childs
- #end
+ def test_ignore_jzero
+ @test_out, o = IO.pipe
+ @test_pid = spawn(*@options[:ruby], TESTS+"/runner.rb",
+ "-j","0", out: File::NULL, err: o)
+ o.close
+ timeout(10) {
+ assert_match(/Error: parameter of -j option should be greater than 0/,@test_out.read)
+ }
+ end
def test_should_run_all_without_any_leaks
spawn_runner
diff --git a/test/testunit/tests_for_parallel/test_third.rb b/test/testunit/tests_for_parallel/test_third.rb
index 16bac16..2746a9b 100644
--- a/test/testunit/tests_for_parallel/test_third.rb
+++ b/test/testunit/tests_for_parallel/test_third.rb
@@ -3,7 +3,7 @@ require_relative "misc.rb"
class TestD < TestCaseForParallelTest
def ptest_fail_at_worker
- if MiniTest::Unit.output != STDOUT
+ if /test\/unit\/parallel\.rb/ =~ $0
assert_equal(0,1)
end
end