File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,8 @@ def flush
148148
149149 def close_read
150150 @closed_read = true
151+ @buffer = nil
152+
151153 @input &.close
152154 @input = nil
153155 end
Original file line number Diff line number Diff line change 1111 let ( :output ) { Protocol ::HTTP ::Body ::Buffered . new }
1212 let ( :stream ) { subject . new ( input , output ) }
1313
14+ with 'no input' do
15+ let ( :input ) { nil }
16+
17+ it "should be empty" do
18+ expect ( stream ) . to be ( :empty? )
19+ end
20+
21+ it "should read nothing" do
22+ expect ( stream . read ) . to be == ""
23+ end
24+ end
25+
1426 with '#empty?' do
1527 it "should be empty" do
1628 expect ( stream ) . to be ( :empty? )
113125
114126 with '#close_read' do
115127 it "should close the input" do
128+ stream . read ( 1 )
116129 stream . close_read
117- expect { stream . read ( 5 ) } . to raise_exception ( IOError )
130+ expect { stream . read ( 1 ) } . to raise_exception ( IOError )
118131 end
119132 end
120133
You can’t perform that action at this time.
0 commit comments