raindrops RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: raindrops@librelist.org
Subject: [PATCH] test_watcher: fix for Ruby trunk r40195 and later
Date: Mon, 2 Sep 2013 10:29:17 +0000	[thread overview]
Message-ID: <20130902102917.GA4800@dcvr.yhbt.net> (raw)
In-Reply-To: <20130902102917.GA4800@dcvr.yhbt.net>

assert_raises doesn't capture exceptions the same way rescue works.
 test/test_watcher.rb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/test/test_watcher.rb b/test/test_watcher.rb
index 5e45dcd..70e8e75 100644
--- a/test/test_watcher.rb
+++ b/test/test_watcher.rb
@@ -154,7 +154,12 @@ class TestWatcher < Test::Unit::TestCase
     assert_equal before, headers["X-Last-Peak-At"], headers.inspect
     @ios << @srv.accept
-    assert_raises(Errno::EAGAIN) { @srv.accept_nonblock }
+    begin
+      @srv.accept_nonblock
+      assert false, "we should not get here"
+    rescue => e
+      assert_kind_of Errno::EAGAIN, e
+    end
     sleep 0.1
     env = @req.class.env_for "/queued/#@addr.txt"
     status, headers, body = @app.call(env.dup)
Eric Wong

           reply	other threads:[~2013-09-02 10:29 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20130902102917.GA4800@dcvr.yhbt.net>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: http://yhbt.net/raindrops/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130902102917.GA4800@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=raindrops@librelist.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


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).