From 1a3bcf103c582b20e9ea70dfed0ee68b24243f55 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 26 Aug 2013 06:27:48 +0000 Subject: 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 --- test/test_timeout.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/test_timeout.rb') 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 -- cgit v1.2.3