diff options
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 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]' |