require 'rubygems' require 'rdoc/markup/formatter_test_case' require 'rdoc/markup/to_html' require 'minitest/autorun' class TestRDocMarkupToHtml < RDoc::Markup::FormatterTestCase add_visitor_tests def setup super @to = RDoc::Markup::ToHtml.new end def test_class_gen_relative_url def gen(from, to) RDoc::Markup::ToHtml.gen_relative_url from, to end assert_equal 'a.html', gen('a.html', 'a.html') assert_equal 'b.html', gen('a.html', 'b.html') assert_equal 'd.html', gen('a/c.html', 'a/d.html') assert_equal '../a.html', gen('a/c.html', 'a.html') assert_equal 'a/c.html', gen('a.html', 'a/c.html') end def accept_blank_line assert_empty @to.res.join end def accept_heading assert_equal "
Hello
\n", @to.res.join end def accept_list_end_bullet assert_equal [], @to.list assert_equal [], @to.in_list_entry assert_equal "\n", @to.res.join end def accept_list_end_label assert_equal [], @to.list assert_equal [], @to.in_list_entry assert_equal "
\n
\n", @to.res.join end def accept_list_end_lalpha assert_equal [], @to.list assert_equal [], @to.in_list_entry assert_equal "
    \n
\n", @to.res.join end def accept_list_end_number assert_equal [], @to.list assert_equal [], @to.in_list_entry assert_equal "
    \n
\n", @to.res.join end def accept_list_end_note assert_equal [], @to.list assert_equal [], @to.in_list_entry assert_equal "\n
\n", @to.res.join end def accept_list_end_ualpha assert_equal [], @to.list assert_equal [], @to.in_list_entry assert_equal "
    \n
\n", @to.res.join end def accept_list_item_end_bullet assert_equal %w[], @to.in_list_entry end def accept_list_item_end_label assert_equal %w[], @to.in_list_entry end def accept_list_item_end_lalpha assert_equal %w[], @to.in_list_entry end def accept_list_item_end_note assert_equal %w[], @to.in_list_entry end def accept_list_item_end_number assert_equal %w[], @to.in_list_entry end def accept_list_item_end_ualpha assert_equal %w[], @to.in_list_entry end def accept_list_item_start_bullet assert_equal "