diff --git a/test/t/module.rb b/test/t/module.rb index 9645c8667..2827f5e27 100644 --- a/test/t/module.rb +++ b/test/t/module.rb @@ -839,6 +839,16 @@ assert('method visibility with meta programming') do f.call c.new.bad! end + + assert_raise NoMethodError do + c = Class.new { + -> { private }.call + def bad! + "BAD!" + end + } + c.new.bad! + end end assert('Module#module_function') do