diff options
Diffstat (limited to 'test/webrick/test_server.rb')
-rw-r--r-- | test/webrick/test_server.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/webrick/test_server.rb b/test/webrick/test_server.rb index 99c59d5056..e00449692b 100644 --- a/test/webrick/test_server.rb +++ b/test/webrick/test_server.rb @@ -47,16 +47,19 @@ class TestWEBrickServer < Test::Unit::TestCase def test_daemon begin r, w = IO.pipe - Process.fork{ + pid1 = Process.fork{ r.close WEBrick::Daemon.start w.puts(Process.pid) - sleep + sleep 10 } - assert(Process.kill(:KILL, r.gets.to_i)) + pid2 = r.gets.to_i + assert(Process.kill(:KILL, pid2)) + assert_not_equal(pid1, pid2) rescue NotImplementedError # snip this test ensure + Process.wait(pid1) if pid1 r.close w.close end |