diff options
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_method.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/bootstraptest/test_method.rb b/bootstraptest/test_method.rb index 2ce66f6a6a..f57bf6214e 100644 --- a/bootstraptest/test_method.rb +++ b/bootstraptest/test_method.rb @@ -1161,3 +1161,17 @@ assert_equal 'ok', %q{ "hello"[0, 1] ||= "H" "ok" } + +assert_equal 'ok', %q{ + class C + define_method(:foo) do + C.class_eval { remove_method(:foo) } + super() + end + end + begin + C.new.foo + rescue NoMethodError + 'ok' + end +} |