about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-09-26 21:31:27 +0000
committerEric Wong <normalperson@yhbt.net>2013-09-26 21:31:27 +0000
commit5deb65e7274a4187033a60c6c859fd92ccfce88e (patch)
tree857d83757f6b78245b7b0db480180af74cd866a9
parentdf5628fee6d8f6c854302d90db5c35ba8dea83c7 (diff)
downloadsleepy_penguin-5deb65e7274a4187033a60c6c859fd92ccfce88e.tar.gz
Ruby 2.1.0 raises a subclass of Errno::EINPROGRESS, which fails the
exact matching of assert_raises.  This does not affect any known
real code.
-rw-r--r--test/test_epoll.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/test_epoll.rb b/test/test_epoll.rb
index 4b4437a..9f6cf85 100644
--- a/test/test_epoll.rb
+++ b/test/test_epoll.rb
@@ -87,7 +87,12 @@ class TestEpoll < Test::Unit::TestCase
     port = srv.addr[1]
     addr = Socket.pack_sockaddr_in(port, host)
     sock = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
-    assert_raises(Errno::EINPROGRESS) { sock.connect_nonblock(addr) }
+    begin
+      sock.connect_nonblock(addr)
+      exc = nil
+    rescue Errno::EINPROGRESS => exc
+    end
+    assert_kind_of Errno::EINPROGRESS, exc
     IO.select(nil, [ sock ], [sock ])
     @ep.add(sock, epflags)
     tmp = []