Skip to content

Commit

Permalink
Update http dependency to ~> 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Feb 12, 2020
1 parent 6907503 commit 86e2722
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/twitter/rest/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def symbolize_keys!(object)
# @return [HTTP::Client, HTTP]
def http_client
client = @client.proxy ? HTTP.via(*proxy) : HTTP
client = client.timeout(:per_operation, connect: @client.timeouts[:connect], read: @client.timeouts[:read], write: @client.timeouts[:write]) if @client.timeouts
client = client.timeout(connect: @client.timeouts[:connect], read: @client.timeouts[:read], write: @client.timeouts[:write]) if @client.timeouts
client
end

Expand Down
4 changes: 2 additions & 2 deletions spec/twitter/rest/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
end
it 'requests with given timeout settings' do
stub_post('/1.1/statuses/update.json').with(body: {status: 'Update'}).to_return(body: fixture('status.json'), headers: {content_type: 'application/json; charset=utf-8'})
expect_any_instance_of(HTTP::Client).to receive(:timeout).with(:per_operation, connect: 2, read: 2, write: 3).and_call_original
expect_any_instance_of(HTTP::Client).to receive(:timeout).with(connect: 2, read: 2, write: 3).and_call_original
@client.update('Update')
end
end
Expand All @@ -53,7 +53,7 @@
end
it 'requests with given timeout settings' do
stub_post('/1.1/statuses/update.json').with(body: {status: 'Update'}).to_return(body: fixture('status.json'), headers: {content_type: 'application/json; charset=utf-8'})
expect(HTTP).to receive(:timeout).with(:per_operation, connect: 2, read: 2, write: 3).and_call_original
expect(HTTP).to receive(:timeout).with(connect: 2, read: 2, write: 3).and_call_original
@client.update('Update')
end
end
Expand Down
2 changes: 1 addition & 1 deletion twitter.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
spec.add_dependency 'addressable', '~> 2.3'
spec.add_dependency 'buftok', '~> 0.2.0'
spec.add_dependency 'equalizer', '~> 0.0.11'
spec.add_dependency 'http', '~> 3.0'
spec.add_dependency 'http', '~> 4.0'
spec.add_dependency 'http-form_data', '~> 2.0'
spec.add_dependency 'http_parser.rb', '~> 0.6.0'
spec.add_dependency 'memoizable', '~> 0.4.0'
Expand Down

0 comments on commit 86e2722

Please sign in to comment.