summaryrefslogtreecommitdiff
path: root/test/socket
diff options
context:
space:
mode:
Diffstat (limited to 'test/socket')
-rw-r--r--test/socket/test_nonblock.rb2
-rw-r--r--test/socket/test_socket.rb4
-rw-r--r--test/socket/test_tcp.rb4
-rw-r--r--test/socket/test_udp.rb4
-rw-r--r--test/socket/test_unix.rb4
5 files changed, 9 insertions, 9 deletions
diff --git a/test/socket/test_nonblock.rb b/test/socket/test_nonblock.rb
index 8086c38e88d..d058add782f 100644
--- a/test/socket/test_nonblock.rb
+++ b/test/socket/test_nonblock.rb
@@ -279,7 +279,7 @@ class TestSocketNonblock < Test::Unit::TestCase
def test_sendmsg_nonblock_seqpacket
buf = '*' * 10000
UNIXSocket.pair(:SEQPACKET) do |s1, s2|
- assert_raises(IO::WaitWritable) do
+ assert_raise(IO::WaitWritable) do
loop { s1.sendmsg_nonblock(buf) }
end
end
diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb
index 1db0ea251d7..3682338b484 100644
--- a/test/socket/test_socket.rb
+++ b/test/socket/test_socket.rb
@@ -78,7 +78,7 @@ class TestSocket < Test::Unit::TestCase
port, = Socket.unpack_sockaddr_in(addr)
Socket.open(Socket::AF_INET, Socket::SOCK_STREAM, 0) {|s|
- e = assert_raises(Errno::EADDRINUSE) do
+ e = assert_raise(Errno::EADDRINUSE) do
s.bind(Socket.sockaddr_in(port, "127.0.0.1"))
end
@@ -556,7 +556,7 @@ class TestSocket < Test::Unit::TestCase
# some platforms may not timeout when the listener queue overflows,
# but we know Linux does with the default listen backlog of SOMAXCONN for
# TCPServer.
- assert_raises(Errno::ETIMEDOUT) do
+ assert_raise(Errno::ETIMEDOUT) do
(Socket::SOMAXCONN*2).times do |i|
sock = Socket.tcp(host, port, :connect_timeout => 0)
assert_equal sock, IO.select(nil, [ sock ])[1][0],
diff --git a/test/socket/test_tcp.rb b/test/socket/test_tcp.rb
index a6c332c6c42..5e3528e242f 100644
--- a/test/socket/test_tcp.rb
+++ b/test/socket/test_tcp.rb
@@ -79,9 +79,9 @@ class TestSocket_TCPSocket < Test::Unit::TestCase
def test_accept_nonblock
TCPServer.open("localhost", 0) {|svr|
- assert_raises(IO::WaitReadable) { svr.accept_nonblock }
+ assert_raise(IO::WaitReadable) { svr.accept_nonblock }
assert_equal :wait_readable, svr.accept_nonblock(exception: false)
- assert_raises(IO::WaitReadable) { svr.accept_nonblock(exception: true) }
+ assert_raise(IO::WaitReadable) { svr.accept_nonblock(exception: true) }
}
end
end if defined?(TCPSocket)
diff --git a/test/socket/test_udp.rb b/test/socket/test_udp.rb
index b07a4b73b34..7d28ec2628b 100644
--- a/test/socket/test_udp.rb
+++ b/test/socket/test_udp.rb
@@ -48,7 +48,7 @@ class TestSocket_UDPSocket < Test::Unit::TestCase
s = UDPSocket.new
- e = assert_raises(Errno::EADDRINUSE) do
+ e = assert_raise(Errno::EADDRINUSE) do
s.bind(host, port)
end
@@ -61,7 +61,7 @@ class TestSocket_UDPSocket < Test::Unit::TestCase
def test_send_too_long
u = UDPSocket.new
- e = assert_raises Errno::EMSGSIZE do
+ e = assert_raise(Errno::EMSGSIZE) do
u.send "\0" * 100_000, 0, "127.0.0.1", 7 # echo
end
diff --git a/test/socket/test_unix.rb b/test/socket/test_unix.rb
index 829eaa90a21..a10f2e51eba 100644
--- a/test/socket/test_unix.rb
+++ b/test/socket/test_unix.rb
@@ -665,8 +665,8 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase
def test_accept_nonblock
bound_unix_socket(UNIXServer) {|serv, path|
- assert_raises(IO::WaitReadable) { serv.accept_nonblock }
- assert_raises(IO::WaitReadable) { serv.accept_nonblock(exception: true) }
+ assert_raise(IO::WaitReadable) { serv.accept_nonblock }
+ assert_raise(IO::WaitReadable) { serv.accept_nonblock(exception: true) }
assert_equal :wait_readable, serv.accept_nonblock(exception: false)
}
end