diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-26 06:27:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-26 06:27:48 +0000 |
commit | 1a3bcf103c582b20e9ea70dfed0ee68b24243f55 (patch) | |
tree | 007c7adbb3b203856095bed267ab2f239e68a85f /test/test_timeout.rb | |
parent | c075b153e8972b5f6fce78c69cbf0a868930622b (diff) |
timeout.rb: skip rescue
* lib/timeout.rb (Timeout#timeout): should not be caught by rescue
clause. [Bug #8730]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_timeout.rb')
-rw-r--r-- | test/test_timeout.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test_timeout.rb b/test/test_timeout.rb index 57eca3e478..4c6065c232 100644 --- a/test/test_timeout.rb +++ b/test/test_timeout.rb @@ -29,4 +29,18 @@ class TestTimeout < Test::Unit::TestCase def (n = Object.new).zero?; false; end assert_raise(TypeError, bug3168) {Timeout.timeout(n) { sleep 0.1 }} end + + def test_skip_rescue + bug8730 = '[Bug #8730]' + e = nil + assert_raise(Timeout::Error, bug8730) do + timeout 0.1 do + begin + sleep 3 + rescue Exception => e + end + end + end + assert_nil(e, bug8730) + end end |