summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-20 06:23:28 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-20 06:23:28 +0000
commita6ed298df738b21b21ed2073bd89bb65565848f7 (patch)
tree25acf6653e5f4ac71aa8d917aadef40dbf3db140 /test
parentd3d00ab8fe750551219655ab5cce0aee77efbe44 (diff)
* lib/rdoc/parser/ruby.rb: Ignore methods defined on constants to
prevent modules with the names of constants from appearing in the documentation. * test/rdoc/test_rdoc_parser_ruby.rb: Test for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/rdoc/test_rdoc_parser_ruby.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_parser_ruby.rb b/test/rdoc/test_rdoc_parser_ruby.rb
index 10ccd46c3d..2c61728571 100644
--- a/test/rdoc/test_rdoc_parser_ruby.rb
+++ b/test/rdoc/test_rdoc_parser_ruby.rb
@@ -1525,6 +1525,21 @@ end
assert ampersand.singleton
end
+ def test_parse_method_constant
+ c = RDoc::Constant.new 'CONST', nil, ''
+ m = @top_level.add_class RDoc::NormalModule, 'M'
+ m.add_constant c
+
+ util_parser "def CONST.m() end"
+
+ tk = @parser.get_tk
+
+ @parser.parse_method m, RDoc::Parser::Ruby::NORMAL, tk, @comment
+
+ assert_empty @store.modules_hash.keys
+ assert_equal %w[M], @store.classes_hash.keys
+ end
+
def test_parse_method_false
util_parser "def false.foo() :bar end"
@@ -1766,6 +1781,14 @@ end
assert_equal "def \317\211", omega.text
end
+ def test_parse_method_dummy
+ util_parser ".method() end"
+
+ @parser.parse_method_dummy @top_level
+
+ assert_nil @parser.get_tk
+ end
+
def test_parse_method_or_yield_parameters_hash
util_parser "({})\n"