From 62c844e343978f233e4f2567fb344411c39e263c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 5 Jan 2011 14:06:00 -0800 Subject: http_parser: add clear method, deprecate reset But allows small optimizations to be made to avoid constant/instance variable lookups later :) --- test/unit/test_http_parser_ng.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/unit/test_http_parser_ng.rb') diff --git a/test/unit/test_http_parser_ng.rb b/test/unit/test_http_parser_ng.rb index e080d9c..b60afdf 100644 --- a/test/unit/test_http_parser_ng.rb +++ b/test/unit/test_http_parser_ng.rb @@ -91,7 +91,7 @@ class HttpParserNgTest < Test::Unit::TestCase @parser.parse end assert @parser.keepalive? - @parser.reset + @parser.clear assert ! @parser.keepalive? assert ! @parser.next? end @@ -491,7 +491,7 @@ class HttpParserNgTest < Test::Unit::TestCase }.each do |uri,expect| assert_equal req, @parser.headers(req.clear, str % [ uri ]) req = req.dup - @parser.reset + @parser.clear assert_equal uri, req["REQUEST_URI"], "REQUEST_URI mismatch" assert_equal expect[qs], req[qs], "#{qs} mismatch" assert_equal expect[pi], req[pi], "#{pi} mismatch" @@ -516,7 +516,7 @@ class HttpParserNgTest < Test::Unit::TestCase }.each do |uri,expect| assert_equal req, @parser.headers(req.clear, str % [ uri ]) req = req.dup - @parser.reset + @parser.clear assert_equal uri, req["REQUEST_URI"], "REQUEST_URI mismatch" assert_equal "example.com", req["HTTP_HOST"], "Host: mismatch" assert_equal expect[qs], req[qs], "#{qs} mismatch" -- cgit v1.2.3-24-ge0c7