summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-25 04:19:33 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-25 04:19:33 +0000
commita71fb38d47d910b421c56e7b28931be12a32d09d (patch)
treec101181cba914978b278be820642bd4fd86b2320 /bootstraptest
parent7c982059ea464cbdb951eab239afdffb2d0553ca (diff)
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@20981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_method.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb
index fff484db73..136fce4970 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]'