File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -64,8 +64,10 @@ def rewind
6464 if @body and @body . respond_to? ( :rewind )
6565 # If the body is not rewindable, this will fail.
6666 @body . rewind
67+
6768 @buffer = nil
6869 @finished = false
70+ @closed = false
6971
7072 return true
7173 end
Original file line number Diff line number Diff line change 5454
5555 it "can rewind after reading all input" do
5656 expect ( input . read ) . to be == sample_data . join
57+ expect ( input ) . to be ( :closed? )
58+
5759 input . rewind
5860
61+ expect ( input ) . not . to be ( :closed? )
5962 expect ( input . read ) . to be == sample_data . join
6063 end
6164
7881
7982 it "can rewind after reading partial input" do
8083 expect ( input . read ( 3 ) ) . to be == "The"
84+ expect ( input ) . not . to be ( :closed? )
85+
8186 input . rewind
8287
88+ expect ( input ) . not . to be ( :closed? )
8389 expect ( input . read ( 3 ) ) . to be == "The"
8490 end
8591
You can’t perform that action at this time.
0 commit comments