File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -98,8 +98,8 @@ def read_partial(length = nil)
9898 return buffer
9999 end
100100
101- def readpartial
102- read_partial or raise EOFError , "End of file reached!"
101+ def readpartial ( length )
102+ read_partial ( length ) or raise EOFError , "End of file reached!"
103103 end
104104
105105 def read_nonblock ( length , buffer = nil )
Original file line number Diff line number Diff line change 123123 end
124124 end
125125
126+ with '#readpartial' do
127+ it "can read partial input" do
128+ expect ( stream . readpartial ( 20 ) ) . to be == "Hello"
129+ expect ( stream . readpartial ( 20 ) ) . to be == "World"
130+ expect { stream . readpartial ( 20 ) } . to raise_exception ( EOFError )
131+ end
132+ end
133+
126134 with '#close_read' do
127135 it "should close the input" do
128136 stream . read ( 1 )
You can’t perform that action at this time.
0 commit comments