diff --git a/library/socket/tcpsocket/shared/new.rb b/library/socket/tcpsocket/shared/new.rb index 5ca3a0e6cc..95dd4a03fe 100644 --- a/library/socket/tcpsocket/shared/new.rb +++ b/library/socket/tcpsocket/shared/new.rb @@ -75,5 +75,12 @@ @socket.addr[1].should be_kind_of(Integer) @socket.addr[2].should =~ /^#{@hostname}/ end + + ruby_version_is "3.0" do + it "connects to a server when passed connect_timeout argument" do + @socket = TCPSocket.send(@method, @hostname, @server.port, connect_timeout: 1) + @socket.should be_an_instance_of(TCPSocket) + end + end end end