diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-01 07:45:16 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-01 07:45:16 +0000 |
commit | 46580b51477355fece514573c88cb67030f4a502 (patch) | |
tree | 779c1a64466643461b3daa4cd9a3548b84f0fd55 /test/rdoc/test_rdoc_parser_simple.rb | |
parent | 9b40cdfe8c973a061c5683ad78c283b9ddb8b2e9 (diff) | |
download | ruby-46580b51477355fece514573c88cb67030f4a502.tar.gz |
Import RDoc 2.5
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27147 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 | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_parser_simple.rb b/test/rdoc/test_rdoc_parser_simple.rb new file mode 100644 index 0000000000..0b35a66c5e --- /dev/null +++ b/test/rdoc/test_rdoc_parser_simple.rb @@ -0,0 +1,48 @@ +require 'tempfile' +require 'rubygems' +require 'minitest/autorun' +require 'rdoc/options' +require 'rdoc/parser' + +class TestRDocParserSimple < MiniTest::Unit::TestCase + + def setup + @tempfile = Tempfile.new self.class.name + filename = @tempfile.path + + @top_level = RDoc::TopLevel.new filename + @fn = filename + @options = RDoc::Options.new + @stats = RDoc::Stats.new 0 + + RDoc::TopLevel.reset + end + + def teardown + @tempfile.close + end + + def test_remove_private_comments + parser = util_parser '' + text = "foo\n\n--\nbar\n++\n\nbaz\n" + + expected = "foo\n\n\n\nbaz\n" + + assert_equal expected, parser.remove_private_comments(text) + end + + def test_remove_private_comments_star + parser = util_parser '' + + text = "* foo\n* bar\n" + expected = text.dup + + assert_equal expected, parser.remove_private_comments(text) + end + + def util_parser(content) + RDoc::Parser::Simple.new @top_level, @fn, content, @options, @stats + end + +end + |