From a44a7de55bb1baf38a2fa793421f61c338fd0917 Mon Sep 17 00:00:00 2001 From: mame Date: Wed, 29 Oct 2008 11:48:35 +0000 Subject: * 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/webrick/test_httpserver.rb | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'test/webrick/test_httpserver.rb') diff --git a/test/webrick/test_httpserver.rb b/test/webrick/test_httpserver.rb index eb685f916..6b0c419ad 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) -- cgit