sleepy_penguin RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* [sleepy.penguin] [PATCH 1/3] test_epoll: minor compatibility fix for Ruby 2.1.0
@ 2013-09-26 21:39 Eric Wong
  2013-09-26 21:39 ` [sleepy.penguin] [PATCH 2/3] avoid RARRAY_PTR usage for Linux-only bits Eric Wong
  2013-09-26 21:40 ` [sleepy.penguin] [PATCH 3/3] init: avoid redefinition warning for _GNU_SOURCE Eric Wong
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Wong @ 2013-09-26 21:39 UTC (permalink / raw)
  To: sleepy.penguin

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.
---
 test/test_epoll.rb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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 = []
-- 
1.8.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-26 21:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-26 21:39 [sleepy.penguin] [PATCH 1/3] test_epoll: minor compatibility fix for Ruby 2.1.0 Eric Wong
2013-09-26 21:39 ` [sleepy.penguin] [PATCH 2/3] avoid RARRAY_PTR usage for Linux-only bits Eric Wong
2013-09-26 21:40 ` [sleepy.penguin] [PATCH 3/3] init: avoid redefinition warning for _GNU_SOURCE Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/sleepy_penguin.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).