summaryrefslogtreecommitdiff
path: root/test/webrick/test_httpresponse.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-12 22:33:56 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-12 22:33:56 +0000
commit0cbec6027cfb755972f80aab57920008d50fe842 (patch)
treec72b0e02d4fa4d19c4c774b2deee261c103083fa /test/webrick/test_httpresponse.rb
parent6ef323d6f8a4cb768ce8217171487d8932bc7bd8 (diff)
* lib/webrick/httpresponse.rb (setup_header): 1xx responses
are allowed to have Keep-Alive connections. * test/webrick/test_httpresponse.rb: corresponding test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/webrick/test_httpresponse.rb')
-rw-r--r--test/webrick/test_httpresponse.rb31
1 files changed, 17 insertions, 14 deletions
diff --git a/test/webrick/test_httpresponse.rb b/test/webrick/test_httpresponse.rb
index 3967e2c..d5d5552 100644
--- a/test/webrick/test_httpresponse.rb
+++ b/test/webrick/test_httpresponse.rb
@@ -15,29 +15,32 @@ module WEBrick
end
end
- def test_304_does_not_log_warning
- logger = FakeLogger.new
- config = Config::HTTP
- config[:Logger] = logger
+ attr_reader :config, :logger, :res
+
+ def setup
+ super
+ @logger = FakeLogger.new
+ @config = Config::HTTP
+ @config[:Logger] = logger
+ @res = HTTPResponse.new config
+ @res.keep_alive = true
+ end
- res = HTTPResponse.new config
+ def test_304_does_not_log_warning
res.status = 304
- res.keep_alive = true
-
res.setup_header
-
assert_equal 0, logger.messages.length
end
def test_204_does_not_log_warning
- logger = FakeLogger.new
- config = Config::HTTP
- config[:Logger] = logger
-
- res = HTTPResponse.new config
res.status = 204
- res.keep_alive = true
+ res.setup_header
+
+ assert_equal 0, logger.messages.length
+ end
+ def test_1xx_does_not_log_warnings
+ res.status = 105
res.setup_header
assert_equal 0, logger.messages.length