about summary refs log tree commit homepage
path: root/test/unit/test_stream_input.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/test_stream_input.rb')
-rw-r--r--test/unit/test_stream_input.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/unit/test_stream_input.rb b/test/unit/test_stream_input.rb
index adf4571..0c4ec98 100644
--- a/test/unit/test_stream_input.rb
+++ b/test/unit/test_stream_input.rb
@@ -21,6 +21,13 @@ class TestStreamInput < Test::Unit::TestCase
     Process.waitall
   end
 
+  def test_read_negative
+    r = init_request('hello')
+    si = Unicorn::StreamInput.new(@rd, r)
+    assert_raises(ArgumentError) { si.read(-1) }
+    assert_equal 'hello', si.read
+  end
+
   def test_read_small
     r = init_request('hello')
     si = Unicorn::StreamInput.new(@rd, r)