diff options
Diffstat (limited to 'test/ruby/test_threadgroup.rb')
-rw-r--r-- | test/ruby/test_threadgroup.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/ruby/test_threadgroup.rb b/test/ruby/test_threadgroup.rb index e29c477247..f4c03de67e 100644 --- a/test/ruby/test_threadgroup.rb +++ b/test/ruby/test_threadgroup.rb @@ -5,10 +5,13 @@ require_relative 'envutil' class TestThreadGroup < Test::Unit::TestCase def test_thread_init thgrp = ThreadGroup.new - Thread.new{ + th = Thread.new{ thgrp.add(Thread.current) - assert_equal(thgrp, Thread.new{sleep 1}.group) - }.join + Thread.new{sleep 1} + }.value + assert_equal(thgrp, th.group) + ensure + th.join end def test_frozen_thgroup |