File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed
test/protocol/rack/adapter Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ class Enumerable < ::Protocol::HTTP::Body::Readable
2626 def self . wrap ( body , length = nil )
2727 if body . respond_to? ( :to_ary )
2828 # This avoids allocating an enumerator, which is more efficient:
29- return ::Protocol ::HTTP ::Body ::Buffered . new ( body . to_ary )
29+ return ::Protocol ::HTTP ::Body ::Buffered . new ( body . to_ary , length )
3030 else
3131 return self . new ( body , length )
3232 end
Original file line number Diff line number Diff line change 5959 let ( :app ) { -> ( env ) { [ 200 , { } , body ] } }
6060
6161 it "should not modify partial responses" do
62- expect ( response . body ) . to be_a ( Protocol ::Rack ::Body ::Enumerable )
62+ expect ( response . body ) . to be_a ( Protocol ::HTTP ::Body ::Buffered )
6363 end
6464 end
6565 end
7878 let ( :app ) { -> ( env ) { [ 200 , { } , [ "Hello" ] ] } }
7979
8080 it "handles array response correctly" do
81- expect ( response . body ) . to be_a ( Protocol ::Rack ::Body ::Enumerable )
81+ expect ( response . body ) . to be_a ( Protocol ::HTTP ::Body ::Buffered )
8282 end
8383 end
8484 end
Original file line number Diff line number Diff line change 5757 let ( :app ) { -> ( env ) { [ 200 , { } , fake_file ] } }
5858
5959 it "should not modify partial responses" do
60- expect ( response . body ) . to be ( :kind_of? , Protocol ::Rack ::Body ::Enumerable )
60+ expect ( response . body ) . to be ( :kind_of? , Protocol ::HTTP ::Body ::Buffered )
6161 end
6262 end
6363 end
Original file line number Diff line number Diff line change 6565 let ( :app ) { -> ( env ) { [ 200 , { } , fake_file ] } }
6666
6767 it "should not modify partial responses" do
68- expect ( response . body ) . to be ( :kind_of? , Protocol ::Rack ::Body ::Enumerable )
68+ expect ( response . body ) . to be ( :kind_of? , Protocol ::HTTP ::Body ::Buffered )
6969 end
7070 end
7171 end
You can’t perform that action at this time.
0 commit comments