Skip to content

Commit

Permalink
Add connect_timeout expect
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanCrg90 committed Oct 14, 2021
1 parent 9597d4b commit cabe0d7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions library/socket/tcpsocket/initialize_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@
@client.local_address.ip_port.should_not == @port
end
end

describe 'when server connection is timeout' do
ruby_version_is "3.0" do
it 'raises Errno::ETIMEDOUT' do
connect_timeout = 0.000000000000001
-> { TCPSocket.new(ip_address, @port, connect_timeout: connect_timeout) }.should raise_error(Errno::ETIMEDOUT)
end
end
end
end
end
end

0 comments on commit cabe0d7

Please sign in to comment.