зеркало из https://github.com/github/ruby.git
[ruby/webrick] Add test for shutdown_pipe
https://github.com/ruby/webrick/commit/1daacc1849
This commit is contained in:
Родитель
d969cf6059
Коммит
c06eab1329
|
@ -160,4 +160,16 @@ class TestWEBrickServer < Test::Unit::TestCase
|
|||
assert_join_threads([client_thread, server_thread])
|
||||
}
|
||||
end
|
||||
|
||||
def test_shutdown_pipe
|
||||
pipe = IO.pipe
|
||||
server = WEBrick::GenericServer.new(
|
||||
:ShutdownPipe => pipe,
|
||||
:BindAddress => '0.0.0.0',
|
||||
:Port => 0,
|
||||
:Logger => WEBrick::Log.new([], WEBrick::BasicLog::WARN))
|
||||
server_thread = Thread.start { server.start }
|
||||
pipe.last.puts('')
|
||||
assert_join_threads([server_thread])
|
||||
end
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче