summaryrefslogtreecommitdiff
path: root/test/webrick/utils.rb
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-31 14:17:41 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-31 14:17:41 +0000
commitaaf78dec43d85058d56dda5518fc757398ccf781 (patch)
tree0874dde56a2015dff66e6d125e74410259cd5bf5 /test/webrick/utils.rb
parentd4c2cca3cbc8bc9268eac16ca1a071b6c0c920b4 (diff)
* lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#proxy_service):
call do_XXX which corespond with request method. (WEBrick::HTTPProxyServer#do_CONNECT,do_GET,do_POST,do_HEAD): added. * test/webrick/test_httpproxy.rb: add test for WEBrick::HTTPProxyServer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/webrick/utils.rb')
-rw-r--r--test/webrick/utils.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/webrick/utils.rb b/test/webrick/utils.rb
index ba03156..dace41a 100644
--- a/test/webrick/utils.rb
+++ b/test/webrick/utils.rb
@@ -17,16 +17,20 @@ module TestWEBrick
def start_server(klass, config={}, &block)
server = klass.new({
:BindAddress => "127.0.0.1", :Port => 0,
+ :ShutdownSocketWithoutClose =>true,
+ :ServerType => Thread,
:Logger => WEBrick::Log.new(NullWriter),
:AccessLog => [[NullWriter, ""]]
}.update(config))
begin
- thread = Thread.start{ server.start }
+ server.start
addr = server.listeners[0].addr
block.yield([server, addr[3], addr[1]])
ensure
- server.stop
- thread.join
+ server.shutdown
+ until server.status == :Stop
+ sleep 0.1
+ end
end
end