From 15689ed7780b06ddc14cde4f427de834177283a5 Mon Sep 17 00:00:00 2001 From: eregon Date: Tue, 12 Dec 2017 18:44:49 +0000 Subject: Fix test-all tests to avoid creating report_on_exception warnings * The warnings are shown by Thread.report_on_exception defaulting to true. [Feature #14143] [ruby-core:83979] * Improves tests by narrowing down the scope where an exception is expected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/rubygems/test_gem_request_connection_pools.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'test/rubygems') diff --git a/test/rubygems/test_gem_request_connection_pools.rb b/test/rubygems/test_gem_request_connection_pools.rb index a9bddb900e..a087095a53 100644 --- a/test/rubygems/test_gem_request_connection_pools.rb +++ b/test/rubygems/test_gem_request_connection_pools.rb @@ -118,13 +118,12 @@ class TestGemRequestConnectionPool < Gem::TestCase pool.checkout - t1 = Thread.new { - Timeout.timeout(1) do - pool.checkout + Thread.new { + assert_raises(Timeout::Error) do + Timeout.timeout(1) do + pool.checkout + end end - } - assert_raises(Timeout::Error) do - t1.join - end + }.join end end -- cgit v1.2.3