diff options
author | Jeremy Evans <[email protected]> | 2022-06-06 09:57:32 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2022-06-06 09:57:32 -0700 |
commit | 7cda7fbbdc14f4262afaa94cdeb5a5987f1eb01a (patch) | |
tree | 6f7da1ed9ce694564c932f9dcc15fd6b04b86c0b /test/ruby/test_module.rb | |
parent | b737998d25f1379117fbf11a578462e6ba12037e (diff) |
Add Module#undefined_instance_methods
Implements [Feature #12655]
Co-authored-by: Nobuyoshi Nakada <[email protected]>
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5733
Merged-By: jeremyevans <[email protected]>
Diffstat (limited to 'test/ruby/test_module.rb')
-rw-r--r-- | test/ruby/test_module.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index c7245ab2db..3dae3916ff 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -994,6 +994,15 @@ class TestModule < Test::Unit::TestCase assert_equal([:bClass1], BClass.public_instance_methods(false)) end + def test_undefined_instance_methods + assert_equal([], AClass.undefined_instance_methods) + assert_equal([], BClass.undefined_instance_methods) + c = Class.new(AClass) {undef aClass} + assert_equal([:aClass], c.undefined_instance_methods) + c = Class.new(c) + assert_equal([], c.undefined_instance_methods) + end + def test_s_public o = (c = Class.new(AClass)).new assert_raise(NoMethodError, /private method/) {o.aClass1} |