about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-09-02 09:53:51 +0000
committerEric Wong <normalperson@yhbt.net>2013-09-02 09:58:26 +0000
commit8e5a4714fd90f87e2bc56c7b3f2525bb9055a227 (patch)
tree92d81188149cb7e1712f720ff7b5b177a0cf6be5
parent07efdceff18dc481424adb8b509244b6c6a822d5 (diff)
downloadraindrops-8e5a4714fd90f87e2bc56c7b3f2525bb9055a227.tar.gz
assert_raises doesn't capture exceptions the same way rescue works.
-rw-r--r--test/test_watcher.rb7
1 files changed, 6 insertions, 1 deletions
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)