diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-09-02 09:53:51 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-09-02 09:58:26 +0000 |
commit | 8e5a4714fd90f87e2bc56c7b3f2525bb9055a227 (patch) | |
tree | 92d81188149cb7e1712f720ff7b5b177a0cf6be5 | |
parent | 07efdceff18dc481424adb8b509244b6c6a822d5 (diff) | |
download | raindrops-8e5a4714fd90f87e2bc56c7b3f2525bb9055a227.tar.gz |
assert_raises doesn't capture exceptions the same way rescue works.
-rw-r--r-- | test/test_watcher.rb | 7 |
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) |