about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--test/unit/test_upload.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/unit/test_upload.rb b/test/unit/test_upload.rb
index 8bb83c5..4c0790f 100644
--- a/test/unit/test_upload.rb
+++ b/test/unit/test_upload.rb
@@ -103,7 +103,11 @@ class UploadTest < Test::Unit::TestCase
     sock.syswrite('12345') # write 4 bytes more than we expected
     @sha1.update('1')
 
-    read = sock.read.split(/\r\n/)
+    buf = sock.readpartial(4096)
+    while buf !~ /\r\n\r\n/
+      buf << sock.readpartial(4096)
+    end
+    read = buf.split(/\r\n/)
     assert_equal "HTTP/1.1 200 OK", read[0]
     resp = eval(read.grep(/^X-Resp: /).first.sub!(/X-Resp: /, ''))
     assert_equal to_upload, resp[:size]