diff --git a/test/protocol/http/body/stream.rb b/test/protocol/http/body/stream.rb index 60956f5..3b117ee 100644 --- a/test/protocol/http/body/stream.rb +++ b/test/protocol/http/body/stream.rb @@ -147,6 +147,16 @@ expect(stream.readpartial(20)).to be == "World" expect{stream.readpartial(20)}.to raise_exception(EOFError) end + + it "can read partial input with buffer" do + buffer = String.new + expect(stream.readpartial(20, buffer)).to be == "Hello" + expect(buffer).to be == "Hello" + expect(stream.readpartial(20, buffer)).to be == "World" + expect(buffer).to be == "World" + expect{stream.readpartial(20, buffer)}.to raise_exception(EOFError) + expect(buffer).to be == "" + end end with '#read_until' do