* [PATCH] test_watcher: fix for Ruby trunk r40195 and later
@ 2013-09-02 10:29 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2013-09-02 10:29 UTC (permalink / raw)
To: raindrops
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-09-02 10:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-02 10:29 [PATCH] test_watcher: fix for Ruby trunk r40195 and later Eric Wong
Code repositories for project(s) associated with this public inbox
https://yhbt.net/raindrops.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).