Sha256: d2abb970f895958426b5d90cfdb965c3f6b28e45fa36e7304cb22ede2eb6b40e

Contents?: true

Size: 1.02 KB

Versions: 9

Compression:

Stored size: 1.02 KB

Contents

require 'rubygems'
require 'minitest/unit'
require 'rdoc/parser'
require 'rdoc/parser/ruby'

class TestRDocParser < MiniTest::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 # HACK for tests in trunk :/
      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)

    jtest_file_name = File.join(File.dirname(__FILE__), "test.ja.txt")
    assert_equal(RDoc::Parser::Simple, RDoc::Parser.can_parse(jtest_file_name))

    jtest_rdoc_file_name = File.join(File.dirname(__FILE__), "test.ja.rdoc")
    assert_equal(RDoc::Parser::Simple, RDoc::Parser.can_parse(jtest_rdoc_file_name))
  end
end

MiniTest::Unit.autorun

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
middleman-0.10.17 vendor/gems/gems/rdoc-2.4.3/test/test_rdoc_parser.rb
middleman-0.10.16 vendor/gems/gems/rdoc-2.4.3/test/test_rdoc_parser.rb
middleman-0.10.15 vendor/gems/gems/rdoc-2.4.3/test/test_rdoc_parser.rb
middleman-0.10.14 vendor/gems/gems/rdoc-2.4.3/test/test_rdoc_parser.rb
rdoc-2.3.0 test/test_rdoc_parser.rb
rdoc-2.4.3 test/test_rdoc_parser.rb
rdoc-2.4.2 test/test_rdoc_parser.rb
rdoc-2.4.0 test/test_rdoc_parser.rb
rdoc-2.4.1 test/test_rdoc_parser.rb