Skip to content

Commit 68f05b3

Browse files
Fix tests.
1 parent 6c72dc9 commit 68f05b3

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

lib/protocol/rack/body/enumerable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

test/protocol/rack/adapter/rack2.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
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
@@ -78,7 +78,7 @@
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

test/protocol/rack/adapter/rack3.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
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

test/protocol/rack/adapter/rack31.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
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

0 commit comments

Comments
 (0)