summaryrefslogtreecommitdiff
path: root/test/webrick
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-13 06:21:50 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-13 06:21:50 +0000
commitdeb0519aec1e68bdcf019d99e3e8be55fd5b2faf (patch)
tree84d30af3bd7bb57ab3fd222e8c43a94992809d40 /test/webrick
parentd2e69f8584577240d59560d0f68300af59430a4c (diff)
* lib/webrick/server.rb (WEBrick::GenericServer#stop): fix r35303;
this method is to deny new connections, not shutdown yet. * lib/webrick/server.rb (WEBrick::GenericServer#start): re-raise exception only when the exception is Interrupt (^C). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/webrick')
-rw-r--r--test/webrick/test_server.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/webrick/test_server.rb b/test/webrick/test_server.rb
index 534fe9b..86fccac 100644
--- a/test/webrick/test_server.rb
+++ b/test/webrick/test_server.rb
@@ -29,23 +29,22 @@ class TestWEBrickServer < Test::Unit::TestCase
:StopCallback => Proc.new{ stopped += 1 },
}
- e = assert_raises(Exception) do
+ e = assert_raises(Interrupt) do
TestWEBrick.start_server(Echo, config) { |server, addr, port, log|
listener = server.listeners.first
def listener.accept
- raise Exception, 'fatal' # simulate ^C
+ Process.kill(:INT, $$) # simulate ^C
end
- true while server.status != :Running
+ Thread.pass while server.status != :Running
TCPSocket.open(addr, port) { |sock| sock << "foo\n" }
- sleep 0.1 until server.status == :Stop
+ Thread.pass until server.status == :Stop
}
end
- assert_equal('fatal', e.message)
assert_equal(stopped, 1)
end