about summary refs log tree commit homepage
path: root/test/unit/test_request.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/test_request.rb')
-rw-r--r--test/unit/test_request.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/test_request.rb b/test/unit/test_request.rb
index 1896300..67ac1b9 100644
--- a/test/unit/test_request.rb
+++ b/test/unit/test_request.rb
@@ -11,7 +11,11 @@ class RequestTest < Test::Unit::TestCase
 
   class MockRequest < StringIO
     alias_method :readpartial, :sysread
+    alias_method :kgio_read!, :sysread
     alias_method :read_nonblock, :sysread
+    def kgio_addr
+      '127.0.0.1'
+    end
   end
 
   def setup
@@ -159,6 +163,14 @@ class RequestTest < Test::Unit::TestCase
     buf = (' ' * bs).freeze
     length = bs * count
     client = Tempfile.new('big_put')
+    def client.kgio_addr; '127.0.0.1'; end
+    def client.kgio_read(*args)
+      readpartial(*args)
+    rescue EOFError
+    end
+    def client.kgio_read!(*args)
+      readpartial(*args)
+    end
     client.syswrite(
       "PUT / HTTP/1.1\r\n" \
       "Host: foo\r\n" \