File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -41,13 +41,13 @@ def finish
41
41
end
42
42
43
43
# Buffer the entire request/response body.
44
- # @returns [Readable] the buffered body .
44
+ # @returns [Reader] itself .
45
45
def buffered!
46
46
if @body
47
47
@body = @body . finish
48
-
49
- return @body
50
48
end
49
+
50
+ return self
51
51
end
52
52
53
53
# Write the body of the response to the given file path.
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ class TestReader
15
15
def initialize ( body )
16
16
@body = body
17
17
end
18
+
19
+ attr :body
18
20
end
19
21
20
22
describe Protocol ::HTTP ::Body ::Reader do
@@ -29,7 +31,8 @@ def initialize(body)
29
31
30
32
with '#buffered!' do
31
33
it 'buffers the body' do
32
- expect ( reader . buffered! ) . to be == body
34
+ expect ( reader . buffered! ) . to be_equal ( reader )
35
+ expect ( reader . body ) . to be == body
33
36
end
34
37
end
35
38
You can’t perform that action at this time.
0 commit comments