diff options
Diffstat (limited to 'test/rdoc/test_rdoc_parser.rb')
-rw-r--r-- | test/rdoc/test_rdoc_parser.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_parser.rb b/test/rdoc/test_rdoc_parser.rb new file mode 100644 index 0000000000..4f71974a5f --- /dev/null +++ b/test/rdoc/test_rdoc_parser.rb @@ -0,0 +1,18 @@ +require 'rdoc/parser' + +class TestRDocParser < Test::Unit::TestCase + def test_can_parse + assert_equal(RDoc::Parser.can_parse(__FILE__), RDoc::Parser::Ruby) + + readme_file_name = File.join(File.dirname(__FILE__), "..", "README.txt") + + unless File.exist? readme_file_name then + readme_file_name = File.join File.dirname(__FILE__), '..', '..', 'README' + end + + assert_equal(RDoc::Parser.can_parse(readme_file_name), RDoc::Parser::Simple) + + binary_file_name = File.join(File.dirname(__FILE__), "binary.dat") + assert_equal(RDoc::Parser.can_parse(binary_file_name), nil) + end +end |