Skip to content

Commit 0d10932

Browse files
committed
🧹
1 parent 9471738 commit 0d10932

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/async/http/faraday/adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def call(env)
153153
end
154154

155155
if body = env.body
156-
# We need to wrap the body in a Readable object so that it can be read in chunks:
156+
# We need to ensure the body is wrapped in a Readable object so that it can be read in chunks:
157157
# Faraday's body only responds to `#read`.
158158
if body.is_a?(::Protocol::HTTP::Body::Readable)
159159
# Good to go

test/async/http/faraday/adapter.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ def get_response(url = bound_url, path = '/index', adapter_options: {})
129129
end
130130

131131
it "can use a ::Protocol::HTTP::Body::Readable body" do
132-
readable = ::Protocol::HTTP::Body::File.new(File.open(__FILE__, 'r'), 0..128)
132+
readable = ::Protocol::HTTP::Body::File.new(File.open(__FILE__, 'r'), 0...128)
133133

134134
response = Faraday.new do |builder|
135135
builder.adapter :async_http
136136
end.post(bound_url, readable)
137137

138-
expect(response.body).to be == File.read(__FILE__, 129)
138+
expect(response.body).to be == File.read(__FILE__, 128)
139139
end
140140
end
141141
end

0 commit comments

Comments
 (0)