raindrops RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / 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
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 index

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://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 \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

raindrops RubyGem user+dev discussion/patches/pulls/bugs/help

Archives are clonable:
	git clone --mirror https://yhbt.net/raindrops-public
	git clone --mirror http://ou63pmih66umazou.onion/raindrops-public

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.raindrops
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.raindrops

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git