1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2013-08-26 06:27:48 +00:00
parent c075b153e8
commit 1a3bcf103c
3 changed files with 41 additions and 14 deletions

View file

@ -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