diff options
Diffstat (limited to 'test/ruby/test_thread.rb')
-rw-r--r-- | test/ruby/test_thread.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index daccadde78..c16aa87896 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -604,6 +604,18 @@ class TestThread < Test::Unit::TestCase end INPUT end + + def test_no_valid_cfp + bug5083 = '[ruby-dev:44208]' + error = assert_raise(RuntimeError) do + Thread.new(&Module.method(:nesting)).join + end + assert_equal("Can't call on top of Fiber or Thread", error.message, bug5083) + error = assert_raise(RuntimeError) do + Thread.new(:to_s, &Module.method(:undef_method)).join + end + assert_equal("Can't call on top of Fiber or Thread", error.message, bug5083) + end end class TestThreadGroup < Test::Unit::TestCase |