diff options
Diffstat (limited to 'test/ruby/test_fiber.rb')
-rw-r--r-- | test/ruby/test_fiber.rb | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/test/ruby/test_fiber.rb b/test/ruby/test_fiber.rb index 92c9961259..7b513a11fa 100644 --- a/test/ruby/test_fiber.rb +++ b/test/ruby/test_fiber.rb @@ -70,10 +70,12 @@ class TestFiber < Test::Unit::TestCase assert_raise(ArgumentError){ Fiber.new # Fiber without block } - assert_raise(FiberError){ - f = Fiber.new{} - Thread.new{f.resume}.join # Fiber yielding across thread - } + f = Fiber.new{} + Thread.new{ + assert_raise(FiberError){ # Fiber yielding across thread + f.resume + } + }.join assert_raise(FiberError){ f = Fiber.new{} f.resume @@ -199,11 +201,11 @@ class TestFiber < Test::Unit::TestCase end def test_resume_root_fiber - assert_raise(FiberError) do - Thread.new do + Thread.new do + assert_raise(FiberError) do Fiber.current.resume - end.join - end + end + end.join end def test_gc_root_fiber @@ -377,4 +379,3 @@ class TestFiber < Test::Unit::TestCase assert_match(/resumed/, Fiber.current.to_s) end end - |