From f23c04aee3419d1081b9609e32166660a27565fe Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 7 Sep 2016 08:21:56 +0000 Subject: timeout.rb: custom error message * lib/timeout.rb (Timeout#timeout): add custom error message argument. [Feature #11650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/test_timeout.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/test_timeout.rb') diff --git a/test/test_timeout.rb b/test/test_timeout.rb index 1af61b7f8b..56b2469978 100644 --- a/test/test_timeout.rb +++ b/test/test_timeout.rb @@ -66,6 +66,11 @@ class TestTimeout < Test::Unit::TestCase sleep 3 end end + assert_raise_with_message(err, /connection to rubylang.org expired/) do + Timeout.timeout 0.01, err, "connection to rubylang.org expired" do + sleep 3 + end + end end def test_exit_exception -- cgit v1.2.3