From 43ad16ce1afbcbf46e6d0f2911b033dc9348ec18 Mon Sep 17 00:00:00 2001 From: yugui Date: Thu, 25 Dec 2008 09:57:05 +0000 Subject: merges r20981 and r20985 from trunk into ruby_1_9_1. * 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/branches/ruby_1_9_1@21034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bootstraptest/test_method.rb | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'bootstraptest/test_method.rb') 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]' -- cgit