diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-21 19:07:28 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-21 19:07:28 +0000 |
commit | 478d37da053f39608fa505991aa69bcff4ade998 (patch) | |
tree | 3abf3cde1f69d8ef0e5d66ee71adfcce9bdead43 /test/net/http/utils.rb | |
parent | e2f75afbfb5e6f156fad47b29979778dd4a47676 (diff) | |
download | ruby-478d37da053f39608fa505991aa69bcff4ade998.tar.gz |
Use 0 for webrick's port and get the actual port. [Bug #6766]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net/http/utils.rb')
-rw-r--r-- | test/net/http/utils.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/net/http/utils.rb b/test/net/http/utils.rb index 07e0b9fa2d..9bea8f5474 100644 --- a/test/net/http/utils.rb +++ b/test/net/http/utils.rb @@ -19,7 +19,8 @@ module TestNetHTTPUtils end def config(key) - self.class::CONFIG[key] + @config ||= self.class::CONFIG + @config[key] end def logfile @@ -42,6 +43,7 @@ module TestNetHTTPUtils end def spawn_server + @config = self.class::CONFIG server_config = { :BindAddress => config('host'), :Port => config('port'), @@ -62,6 +64,7 @@ module TestNetHTTPUtils @server = WEBrick::HTTPServer.new(server_config) @server.mount('/', Servlet, config('chunked')) @server.start + @config['port'] = @server[:Port] if @config['port'] == 0 n_try_max = 5 begin TCPSocket.open(config('host'), config('port')).close |