Add more test code for method visibility

This test corresponds to the first issue of #6494.
Complement to #6512.
This commit is contained in:
dearblue
2025-05-18 18:50:02 +09:00
parent b952ca30cd
commit 4417321d1c
+10
View File
@@ -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