diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-25 04:19:33 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-25 04:19:33 +0000 |
commit | 834e9bdf1c0f4d7bd85466fd4cc6b52f5bae7a3d (patch) | |
tree | c101181cba914978b278be820642bd4fd86b2320 /bootstraptest | |
parent | 8f21d253f5ed2b73c01318b3d8de25c4aff14569 (diff) | |
download | ruby-834e9bdf1c0f4d7bd85466fd4cc6b52f5bae7a3d.tar.gz ruby-834e9bdf1c0f4d7bd85466fd4cc6b52f5bae7a3d.tar.xz ruby-834e9bdf1c0f4d7bd85466fd4cc6b52f5bae7a3d.zip |
* vm_insnhelper.c (vm_method_search): return rb_cObject if there is no
super class. [ruby-dev:37587]
* bootstraptest/test_method.rb: add tests for above.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_method.rb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb index fff484db7..136fce497 100644 --- a/bootstraptest/test_method.rb +++ b/bootstraptest/test_method.rb @@ -1103,3 +1103,40 @@ assert_equal '["B", "A"]', %q{ C.new.m } + +assert_equal 'ok', %q{ + module Foo + def foo + begin + super + rescue NoMethodError + :ok + end + end + module_function :foo + end + Foo.foo +}, '[ruby-dev:37587]' + +assert_equal 'Object#foo', %q{ + class Object + def self.foo + "Object.foo" + end + def foo + "Object#foo" + end + end + + module Foo + def foo + begin + super + rescue NoMethodError + :ok + end + end + module_function :foo + end + Foo.foo +}, '[ruby-dev:37587]' |