Skip to content

Commit

Permalink
Wrap ETIMEDOUT on ruby_version_is block
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanCrg90 committed Oct 16, 2021
1 parent 8e423c4 commit 2391bbc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions library/socket/tcpsocket/shared/new.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
}
end

it 'raises Errno::ETIMEDOUT with :connect_timeout when no server is listening on the given address' do
-> {
TCPSocket.send(@method, "192.0.2.1", 80, connect_timeout: 0)
}.should raise_error(Errno::ETIMEDOUT)
ruby_version_is "3.0" do
it 'raises Errno::ETIMEDOUT with :connect_timeout when no server is listening on the given address' do
-> {
TCPSocket.send(@method, "192.0.2.1", 80, connect_timeout: 0)
}.should raise_error(Errno::ETIMEDOUT)
end
end

describe "with a running server" do
Expand Down

0 comments on commit 2391bbc

Please sign in to comment.