Skip to content

Commit

Permalink
Added note for twitter [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Oct 4, 2021
1 parent 9a9bc19 commit 731f9ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1458,6 +1458,8 @@ end

Raises `HTTP::TimeoutError`

**Note:** All three timeouts must be set for any to take effect.

### yt

Not configurable at the moment, and no timeout by default
Expand Down
10 changes: 4 additions & 6 deletions test/twitter_test.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
require_relative "test_helper"

class TwitterTest < Minitest::Test
def setup
skip
end

def test_connect
assert_raises(HTTP::TimeoutError) do
Twitter::REST::Request.send(:remove_const, "BASE_URL")
Twitter::REST::Request.const_set("BASE_URL", connect_url)
client = Twitter::REST::Client.new do |config|
config.timeouts = {connect: 1}
# must all be set
config.timeouts = {connect: 1, read: 30, write: 30}
end
client.followers
end
Expand All @@ -21,7 +18,8 @@ def test_read
Twitter::REST::Request.send(:remove_const, "BASE_URL")
Twitter::REST::Request.const_set("BASE_URL", read_url)
client = Twitter::REST::Client.new do |config|
config.timeouts = {read: 1}
# must all be set
config.timeouts = {connect: 30, read: 1, write: 30}
end
client.followers
end
Expand Down

0 comments on commit 731f9ba

Please sign in to comment.