mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/webrick/test_server.rb (test_daemon): simply use fork's return
value, don't use pipe. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e5dc8988af
commit
ae76a2323e
1 changed files with 2 additions and 8 deletions
|
@ -46,19 +46,13 @@ class TestWEBrickServer < Test::Unit::TestCase
|
||||||
|
|
||||||
def test_daemon
|
def test_daemon
|
||||||
begin
|
begin
|
||||||
r, w = IO.pipe
|
pid = Process.fork{
|
||||||
Process.fork{
|
|
||||||
r.close
|
|
||||||
WEBrick::Daemon.start
|
WEBrick::Daemon.start
|
||||||
w.puts(Process.pid)
|
|
||||||
sleep
|
sleep
|
||||||
}
|
}
|
||||||
assert(Process.kill(:KILL, r.gets.to_i))
|
assert(Process.kill(:KILL, pid))
|
||||||
rescue NotImplementedError
|
rescue NotImplementedError
|
||||||
# snip this test
|
# snip this test
|
||||||
ensure
|
|
||||||
r.close
|
|
||||||
w.close
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue