summaryrefslogtreecommitdiff
path: root/test/socket/test_socket.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-01 12:42:50 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-01 12:42:50 +0000
commit6dea556eb7f85f234a0b698aa0dd4b1882c4e8ca (patch)
tree484531e9a3a8a6a549e8c3a4f3cbe165421d8885 /test/socket/test_socket.rb
parentbb9464dea8f8f49facfe727a9f9816be98d3aed4 (diff)
downloadruby-6dea556eb7f85f234a0b698aa0dd4b1882c4e8ca.tar.gz
* test/socket/test_addrinfo.rb: extract Errno::EADDRINUSE as a method.
* test/socket/test_socket.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/socket/test_socket.rb')
-rw-r--r--test/socket/test_socket.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb
index a75a545122..01d4652abb 100644
--- a/test/socket/test_socket.rb
+++ b/test/socket/test_socket.rb
@@ -105,11 +105,15 @@ class TestSocket < Test::Unit::TestCase
49152 + rand(65535-49152+1)
end
+ def errors_addrinuse
+ [Errno::EADDRINUSE]
+ end
+
def test_tcp_server_sockets
port = random_port
begin
sockets = Socket.tcp_server_sockets(port)
- rescue Errno::EADDRINUSE
+ rescue *errors_addrinuse
return # not test failure
end
begin