From 25bbb88bcc16c1c0a10efc99472b05e9f6b45861 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 6 Feb 2009 14:52:10 -0800 Subject: Get rid of HeaderOut and simplify HttpResponse Just stuff what little logic we had for it into HttpResponse since Rack takes care of the rest for us. Put the HTTP_STATUS_HEADERS hash in HttpResponse since we're the only user of it. Also, change HttpResponse.send to HttpResponse.write to avoid overriding the default method. --- test/unit/test_response.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/unit/test_response.rb b/test/unit/test_response.rb index b142c07..5d60594 100644 --- a/test/unit/test_response.rb +++ b/test/unit/test_response.rb @@ -12,21 +12,21 @@ class ResponseTest < Test::Unit::TestCase def test_response_headers out = StringIO.new - HttpResponse.send(out,[200, {"X-Whatever" => "stuff"}, ["cool"]]) + HttpResponse.write(out,[200, {"X-Whatever" => "stuff"}, ["cool"]]) assert out.length > 0, "output didn't have data" end def test_response_200 io = StringIO.new - HttpResponse.send(io, [200, {}, []]) + HttpResponse.write(io, [200, {}, []]) assert io.length > 0, "output didn't have data" end def test_response_with_default_reason code = 400 io = StringIO.new - HttpResponse.send(io, [code, {}, []]) + HttpResponse.write(io, [code, {}, []]) io.rewind assert_match(/.* #{HTTP_STATUS_CODES[code]}$/, io.readline.chomp, "wrong default reason phrase") end -- cgit v1.2.3-24-ge0c7