summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMasaki Matsushita <glass.saga@gmail.com>2020-08-28 13:07:31 +0900
committerMasaki Matsushita <glass.saga@gmail.com>2020-09-25 15:19:14 +0900
commit511fe23fa2bdf1f17faa91e0558be47b5bb62b2a (patch)
tree203566d21fc91aaf6fe8c6c4c1125a641b521661 /test
parentb72f9200acf88e60c850a2d400554ff38f81194d (diff)
Add resolve_timeout to TCPSocket [Feature #17134]
Diffstat (limited to 'test')
-rw-r--r--test/socket/test_tcp.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/socket/test_tcp.rb b/test/socket/test_tcp.rb
index 11325fdedb..15c79b7519 100644
--- a/test/socket/test_tcp.rb
+++ b/test/socket/test_tcp.rb
@@ -55,6 +55,20 @@ class TestSocket_TCPSocket < Test::Unit::TestCase
t.close if t && !t.closed?
end
+ def test_initialize_resolv_timeout
+ TCPServer.open("localhost", 0) do |svr|
+ th = Thread.new {
+ c = svr.accept
+ c.close
+ }
+ addr = svr.addr
+ s = TCPSocket.new(addr[3], addr[1], resolv_timeout: 10)
+ th.join
+ ensure
+ s.close()
+ end
+ end
+
def test_recvfrom
TCPServer.open("localhost", 0) {|svr|
th = Thread.new {