diff options
author | ktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-09-03 15:54:44 +0000 |
---|---|---|
committer | ktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-09-03 15:54:44 +0000 |
commit | 7c9b9977b0f3ff367e96f9901761f97b9e3c8b97 (patch) | |
tree | 200db20e832bae912bf97527de4ed840a45fa674 /test/ruby | |
parent | aa6ebbe3298cd11e24a7726c9fc8ad57879975ac (diff) | |
download | ruby-7c9b9977b0f3ff367e96f9901761f97b9e3c8b97.tar.gz |
* test/ruby/test_fiber.rb (TestFiber#test_no_valid_cfp):
add a test. Unlike TestThread#test_no_valid_cfp,
this test succeeds even if win32ole is required (see r33153).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_fiber.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_fiber.rb b/test/ruby/test_fiber.rb index e3e40566f8..ed7ecc71ae 100644 --- a/test/ruby/test_fiber.rb +++ b/test/ruby/test_fiber.rb @@ -208,5 +208,17 @@ class TestFiber < Test::Unit::TestCase GC.start }, bug4612 end + + def test_no_valid_cfp + bug5083 = '[ruby-dev:44208]' + error = assert_raise(RuntimeError) do + Fiber.new(&Module.method(:nesting)).resume + end + assert_equal("Can't call on top of Fiber or Thread", error.message, bug5083) + error = assert_raise(RuntimeError) do + Fiber.new(&Module.method(:undef_method)).resume(:to_s) + end + assert_equal("Can't call on top of Fiber or Thread", error.message, bug5083) + end end |