2008-10-24 19:05:28 -04:00
|
|
|
require 'rubygems'
|
|
|
|
require 'minitest/unit'
|
2008-09-24 22:43:03 -04:00
|
|
|
require 'rdoc/parser'
|
2008-10-24 19:05:28 -04:00
|
|
|
require 'rdoc/parser/ruby'
|
2008-09-24 22:43:03 -04:00
|
|
|
|
2008-10-24 19:05:28 -04:00
|
|
|
class TestRDocParser < MiniTest::Unit::TestCase
|
2008-09-24 22:43:03 -04:00
|
|
|
def test_can_parse
|
|
|
|
assert_equal(RDoc::Parser.can_parse(__FILE__), RDoc::Parser::Ruby)
|
|
|
|
|
|
|
|
readme_file_name = File.join(File.dirname(__FILE__), "..", "README.txt")
|
|
|
|
|
2008-10-24 19:05:28 -04:00
|
|
|
unless File.exist? readme_file_name then # HACK for tests in trunk :/
|
2008-09-24 22:43:03 -04:00
|
|
|
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
|
2008-10-24 19:05:28 -04:00
|
|
|
|
|
|
|
MiniTest::Unit.autorun
|