Skip to content

Commit

Permalink
Improved open-uri example [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Feb 3, 2023
1 parent 398dba1 commit 260fd28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ Raises
### open-uri

```ruby
URI.open(url, open_timeout: 1, read_timeout: 1)
URI.parse(url).open(open_timeout: 1, read_timeout: 1)
```

Raises
Expand Down
4 changes: 2 additions & 2 deletions test/open_uri_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
class OpenUriTest < Minitest::Test
def test_connect
assert_timeout(Net::OpenTimeout) do
URI.open(connect_url, open_timeout: 1)
URI.parse(connect_url).open(open_timeout: 1)
end
end

def test_read
assert_timeout(Net::ReadTimeout) do
URI.open(read_url, read_timeout: 1)
URI.parse(read_url).open(read_timeout: 1)
end
end
end

0 comments on commit 260fd28

Please sign in to comment.