From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS47066 71.19.144.0/20 X-Spam-Status: No, score=-1.9 required=3.0 tests=AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: normalperson@yhbt.net Received: from zedshaw2.xen.prgmr.com (zedshaw2.xen.prgmr.com [71.19.156.177]) by dcvr.yhbt.net (Postfix) with ESMTP id 6E5D91F795 for ; Thu, 26 Sep 2013 21:40:13 +0000 (UTC) Received: from zedshaw2.xen.prgmr.com (unknown [IPv6:::1]) by zedshaw2.xen.prgmr.com (Postfix) with ESMTP id 234C374EA5 for ; Thu, 26 Sep 2013 21:50:56 +0000 (UTC) MIME-Version: 1.0 Date: Thu, 26 Sep 2013 21:39:58 +0000 From: Eric Wong In-Reply-To: <1380231600-27298-1-git-send-email-normalperson@yhbt.net> List-Archive: List-Help: List-Id: List-Post: List-Subscribe: List-Unsubscribe: Message-Id: <1380231600-27298-1-git-send-email-normalperson@yhbt.net> Precedence: list References: <1380231600-27298-1-git-send-email-normalperson@yhbt.net> Sender: sleepy.penguin@librelist.org Subject: [sleepy.penguin] [PATCH 1/3] test_epoll: minor compatibility fix for Ruby 2.1.0 To: sleepy.penguin@librelist.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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