summaryrefslogtreecommitdiff
path: root/test/webrick/test_httpserver.rb
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-29 11:48:35 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-29 11:48:35 +0000
commit224471fd572c1818e99c66f756ce398745885398 (patch)
tree8f02ccee39290f8aa03b81c401d801ba4ac0d601 /test/webrick/test_httpserver.rb
parent3056933cc0b7c1d68ddda1a143bfa298a92f4a0c (diff)
* test/webrick/utils.rb (start_server): provide a reference to log of
webrick. * test/webrick/test_httpproxy.rb, test/webrick/test_httpauth.rb, test/webrick/test_cgi.rb, test/webrick/test_httpserver.rb, test/webrick/test_server.rb, test/webrick/test_filehandler.rb: use webrick log as an assertion message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/webrick/test_httpserver.rb')
-rw-r--r--test/webrick/test_httpserver.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/webrick/test_httpserver.rb b/test/webrick/test_httpserver.rb
index eb685f916d..6b0c419ad7 100644
--- a/test/webrick/test_httpserver.rb
+++ b/test/webrick/test_httpserver.rb
@@ -223,7 +223,7 @@ class TestWEBrickHTTPServer < Test::Unit::TestCase
:StopCallback => Proc.new{ stopped += 1 },
:RequestCallback => Proc.new{|req, res| requested0 += 1 },
}
- TestWEBrick.start_httpserver(config){|server, addr, port|
+ TestWEBrick.start_httpserver(config){|server, addr, port, log|
vhost_config = {
:ServerName => "myhostname",
:BindAddress => addr,
@@ -236,23 +236,23 @@ class TestWEBrickHTTPServer < Test::Unit::TestCase
server.virtual_host(WEBrick::HTTPServer.new(vhost_config))
true while server.status != :Running
- assert_equal(started, 1)
- assert_equal(stopped, 0)
- assert_equal(accepted, 0)
+ assert_equal(started, 1, log.call)
+ assert_equal(stopped, 0, log.call)
+ assert_equal(accepted, 0, log.call)
http = Net::HTTP.new(addr, port)
req = Net::HTTP::Get.new("/")
req["Host"] = "myhostname:#{port}"
- http.request(req){|res| assert_equal("404", res.code)}
- http.request(req){|res| assert_equal("404", res.code)}
- http.request(req){|res| assert_equal("404", res.code)}
+ http.request(req){|res| assert_equal("404", res.code, log.call)}
+ http.request(req){|res| assert_equal("404", res.code, log.call)}
+ http.request(req){|res| assert_equal("404", res.code, log.call)}
req["Host"] = "localhost:#{port}"
- http.request(req){|res| assert_equal("404", res.code)}
- http.request(req){|res| assert_equal("404", res.code)}
- http.request(req){|res| assert_equal("404", res.code)}
- assert_equal(6, accepted)
- assert_equal(3, requested0)
- assert_equal(3, requested1)
+ http.request(req){|res| assert_equal("404", res.code, log.call)}
+ http.request(req){|res| assert_equal("404", res.code, log.call)}
+ http.request(req){|res| assert_equal("404", res.code, log.call)}
+ assert_equal(6, accepted, log.call)
+ assert_equal(3, requested0, log.call)
+ assert_equal(3, requested1, log.call)
}
assert_equal(started, 1)
assert_equal(stopped, 1)