Skip to content

Commit

Permalink
Merge 5fa82db into 844818c
Browse files Browse the repository at this point in the history
  • Loading branch information
renatolond committed Jan 15, 2020
2 parents 844818c + 5fa82db commit b3d9b98
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Expand Up @@ -18,6 +18,9 @@ env:
global:
- JRUBY_OPTS="$JRUBY_OPTS --debug"

before_install:
- gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
- gem install bundler -v '< 2'
matrix:
allow_failures:
- rvm: jruby-head
Expand Down
2 changes: 1 addition & 1 deletion lib/twitter/rest/request.rb
Expand Up @@ -118,7 +118,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
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
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 b3d9b98

Please sign in to comment.