about summary refs log tree commit homepage
path: root/test/unit/test_server.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-06-10 16:00:08 -0700
committerEric Wong <normalperson@yhbt.net>2009-06-10 16:00:08 -0700
commit4651cd8b7c10d18bc745b84ebc7a55aad07d6077 (patch)
tree01ae0123891d16aa51ab18ff7c65d2dd1f3e733f /test/unit/test_server.rb
parentb0013b043a15d77d810d5965157766c1af364db2 (diff)
downloadunicorn-4651cd8b7c10d18bc745b84ebc7a55aad07d6077.tar.gz
No point in making syscalls to deal with empty bodies.
Reinstate usage of the NULL_IO object which allows us
to avoid allocating new objects.
Diffstat (limited to 'test/unit/test_server.rb')
-rw-r--r--test/unit/test_server.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/unit/test_server.rb b/test/unit/test_server.rb
index 742b240..0ce373f 100644
--- a/test/unit/test_server.rb
+++ b/test/unit/test_server.rb
@@ -152,9 +152,18 @@ class WebServerTest < Test::Unit::TestCase
 
   def test_file_streamed_request
     body = "a" * (Unicorn::Const::MAX_BODY * 2)
-    long = "GET /test HTTP/1.1\r\nContent-length: #{body.length}\r\n\r\n" + body
+    long = "PUT /test HTTP/1.1\r\nContent-length: #{body.length}\r\n\r\n" + body
     do_test(long, Unicorn::Const::CHUNK_SIZE * 2 -400)
   end
 
+  def test_file_streamed_request_bad_method
+    body = "a" * (Unicorn::Const::MAX_BODY * 2)
+    long = "GET /test HTTP/1.1\r\nContent-length: #{body.length}\r\n\r\n" + body
+    assert_raises(EOFError,Errno::ECONNRESET,Errno::EPIPE,Errno::EINVAL,
+                  Errno::EBADF) {
+      do_test(long, Unicorn::Const::CHUNK_SIZE * 2 -400)
+    }
+  end
+
 end