Skip to content

Commit

Permalink
Add test for shutdown_pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
wishdev authored and jeremyevans committed Jul 21, 2020
1 parent 30152b4 commit 1daacc1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/webrick/test_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,16 @@ def <<(msg)
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

0 comments on commit 1daacc1

Please sign in to comment.