ruby-changes:63069
From: John <ko1@a...>
Date: Thu, 24 Sep 2020 21:42:22 +0900 (JST)
Subject: [ruby-changes:63069] c06eab1329 (master): [ruby/webrick] Add test for shutdown_pipe
https://git.ruby-lang.org/ruby.git/commit/?id=c06eab1329 From c06eab13290757fc326bb2a6e3ac25cd53e00894 Mon Sep 17 00:00:00 2001 From: John W Higgins <wishdev@g...> Date: Mon, 20 Jul 2020 22:55:47 -0700 Subject: [ruby/webrick] Add test for shutdown_pipe https://github.com/ruby/webrick/commit/1daacc1849 diff --git a/test/webrick/test_server.rb b/test/webrick/test_server.rb index 8162a18..9a3a8f1 100644 --- a/test/webrick/test_server.rb +++ b/test/webrick/test_server.rb @@ -160,4 +160,16 @@ class TestWEBrickServer < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/webrick/test_server.rb#L160 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 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/