diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-11-20 08:07:12 +0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-11-20 08:07:12 +0800 |
commit | ad268cea66c2b91538dd60fc7f945348bb24214d (patch) | |
tree | 74bb792868ce7b4cf4422ffe6096189c14f676dd /test/unit/test_tee_input.rb | |
parent | cd315e5a20b17d29679fb22b4e2ab44cd6d0edeb (diff) | |
download | unicorn-ad268cea66c2b91538dd60fc7f945348bb24214d.tar.gz |
Some apps may do them, so make sure we do them correctly.
Diffstat (limited to 'test/unit/test_tee_input.rb')
-rw-r--r-- | test/unit/test_tee_input.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/unit/test_tee_input.rb b/test/unit/test_tee_input.rb index e69c8f1..3766e1f 100644 --- a/test/unit/test_tee_input.rb +++ b/test/unit/test_tee_input.rb @@ -267,6 +267,14 @@ class TestTeeInput < Test::Unit::TestCase assert_equal "World", @env['HTTP_HELLO'] end + def test_gets_read_mix + r = init_request("hello\nasdfasdf") + ti = Unicorn::TeeInput.new(@rd, r) + assert_equal "hello\n", ti.gets + assert_equal "asdfasdf", ti.read(9) + assert_nil ti.read(9) + end + private def init_request(body, size = nil) |