summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-07 08:21:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-07 08:21:56 +0000
commit047ca4ba1a690d28eaa752abb3f19d7f0aad21fe (patch)
tree8421da14e206306449166ff9b82750db207fa9f4 /test
parent62e8ceae1126ecaeb47e89c725b223a91751afe6 (diff)
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
Diffstat (limited to 'test')
-rw-r--r--test/test_timeout.rb5
1 files changed, 5 insertions, 0 deletions
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