diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-20 03:22:49 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-20 03:22:49 +0000 |
commit | 2ef9c50c6e405717d06362787c4549ca4f1c6485 (patch) | |
tree | ee99486567461dd5796f3d6edcc9e204187f2666 /test/rdoc/test_rdoc_parser_simple.rb | |
parent | d7effd506f5b91a636f2e6452ef1946b923007c7 (diff) | |
download | ruby-2ef9c50c6e405717d06362787c4549ca4f1c6485.tar.gz |
Import RDoc 3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc/test_rdoc_parser_simple.rb')
-rw-r--r-- | test/rdoc/test_rdoc_parser_simple.rb | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/test/rdoc/test_rdoc_parser_simple.rb b/test/rdoc/test_rdoc_parser_simple.rb index d09cced5a4..8cedfaa2fc 100644 --- a/test/rdoc/test_rdoc_parser_simple.rb +++ b/test/rdoc/test_rdoc_parser_simple.rb @@ -41,7 +41,6 @@ contents of a string. parser.scan expected = <<-TEXT.strip - Regular expressions (<i>regexp</i>s) are patterns which describe the contents of a string. TEXT @@ -49,6 +48,31 @@ contents of a string. assert_equal expected, @top_level.comment end + # RDoc stops processing comments if it finds a comment line CONTAINING + # '<tt>#--</tt>'. This can be used to separate external from internal + # comments, or to stop a comment being associated with a method, + # class, or module. Commenting CAN be turned back on with + # a line that STARTS '<tt>#++</tt>'. + # + # I've seen guys that comment their code like this: + # # This method.... + # #----------------- + # def method + # + # => either we do it only in ruby code, or we require the leading # + # (to avoid conflict with rules). + # + # TODO: require the leading #, to provide the feature in simple text files. + # Note: in ruby & C code, we require '#--' & '#++' or '*--' & '*++', + # to allow rules: + # + # # this is a comment + # #--- + # # private text + # #+++ + # # this is a rule: + # # --- + def test_remove_private_comments parser = util_parser '' text = "foo\n\n--\nbar\n++\n\nbaz\n" |