summaryrefslogtreecommitdiff
path: root/test/webrick
diff options
context:
space:
mode:
Diffstat (limited to 'test/webrick')
-rw-r--r--test/webrick/test_server.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/webrick/test_server.rb b/test/webrick/test_server.rb
index b688d52018..99c59d5056 100644
--- a/test/webrick/test_server.rb
+++ b/test/webrick/test_server.rb
@@ -46,13 +46,19 @@ class TestWEBrickServer < Test::Unit::TestCase
def test_daemon
begin
- pid = Process.fork{
+ r, w = IO.pipe
+ Process.fork{
+ r.close
WEBrick::Daemon.start
+ w.puts(Process.pid)
sleep
}
- assert(Process.kill(:KILL, pid))
+ assert(Process.kill(:KILL, r.gets.to_i))
rescue NotImplementedError
# snip this test
+ ensure
+ r.close
+ w.close
end
end
end