From 8daf254356241c135ad2c843de567910528a10a7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 7 Oct 2010 06:55:22 +0000 Subject: start using more compact parser API This should be easier for Rainbows! to use --- test/unit/test_tee_input.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/unit/test_tee_input.rb b/test/unit/test_tee_input.rb index 263aa8a..a10ca34 100644 --- a/test/unit/test_tee_input.rb +++ b/test/unit/test_tee_input.rb @@ -5,7 +5,6 @@ require 'digest/sha1' require 'unicorn' class TestTeeInput < Test::Unit::TestCase - MockRequest = Struct.new(:env, :parser, :buf) def setup @rs = $/ @@ -164,7 +163,7 @@ class TestTeeInput < Test::Unit::TestCase @wr.write("0\r\n\r\n") } @wr.close - ti = Unicorn::TeeInput.new(@rd, MockRequest.new(@env, @parser, @buf)) + ti = Unicorn::TeeInput.new(@rd, @parser) assert_nil @parser.content_length assert_nil ti.len assert ! @parser.body_eof? @@ -202,7 +201,7 @@ class TestTeeInput < Test::Unit::TestCase end @wr.write("0\r\n\r\n") } - ti = Unicorn::TeeInput.new(@rd, MockRequest.new(@env, @parser, @buf)) + ti = Unicorn::TeeInput.new(@rd, @parser) assert_nil @parser.content_length assert_nil ti.len assert ! @parser.body_eof? @@ -231,7 +230,7 @@ class TestTeeInput < Test::Unit::TestCase @wr.write("Hello: World\r\n\r\n") } @wr.close - ti = Unicorn::TeeInput.new(@rd, MockRequest.new(@env, @parser, @buf)) + ti = Unicorn::TeeInput.new(@rd, @parser) assert_nil @parser.content_length assert_nil ti.len assert ! @parser.body_eof? @@ -253,7 +252,7 @@ private "\r\n#{body}" assert_equal @env, @parser.headers(@env, @buf) assert_equal body, @buf - MockRequest.new(@env, @parser, @buf) + @parser end end -- cgit v1.2.3-24-ge0c7