diff options
author | Nobuyoshi Nakada <[email protected]> | 2024-01-07 19:44:14 +0900 |
---|---|---|
committer | git <[email protected]> | 2024-01-07 11:39:45 +0000 |
commit | 2325b72cf3f14448603a97024c112d8dde159f5a (patch) | |
tree | 7ea1bce0ade4f25473cd927415118782af3dfa21 /test | |
parent | 83c98ead4e889710916a367c146884c987576e8b (diff) |
[ruby/rdoc] Singleton method visibility should be isolated
Each singleton method definition of the form `def recv.method` has
visibility separate from the outer scope and is set to `public` by
default.
https://github.com/ruby/rdoc/commit/810913a7ea
Diffstat (limited to 'test')
-rw-r--r-- | test/rdoc/test_rdoc_context.rb | 2 | ||||
-rw-r--r-- | test/rdoc/xref_data.rb | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_context.rb b/test/rdoc/test_rdoc_context.rb index 85665599fb..ac425349d8 100644 --- a/test/rdoc/test_rdoc_context.rb +++ b/test/rdoc/test_rdoc_context.rb @@ -927,6 +927,8 @@ class TestRDocContext < XrefTestCase assert_equal :private, @c6.find_method_named('priv6').visibility assert_equal :protected, @c6.find_method_named('prot6').visibility assert_equal :public, @c6.find_method_named('pub6').visibility + assert_equal :public, @c6.find_method_named('s_pub1').visibility + assert_equal :public, @c6.find_method_named('s_pub3').visibility end def util_visibilities diff --git a/test/rdoc/xref_data.rb b/test/rdoc/xref_data.rb index c9315b7806..42b5d1baf3 100644 --- a/test/rdoc/xref_data.rb +++ b/test/rdoc/xref_data.rb @@ -74,6 +74,7 @@ class C6 def priv4() end public def pub5() end def priv5() end + def self.s_pub1() end protected private def priv6() end @@ -82,6 +83,7 @@ class C6 def prot5() end public def pub6() end def prot6() end + def self.s_pub3() end end class C7 |