cat | ", @to.res.join
end
def accept_list_item_start_number
assert_equal "\n- ", @to.res.join
end
def accept_list_item_start_ualpha
assert_equal "
\n- ", @to.res.join
end
def accept_list_start_bullet
assert_equal [:BULLET], @to.list
assert_equal [false], @to.in_list_entry
assert_equal "
\n", @to.res.join
end
def accept_list_start_label
assert_equal [:LABEL], @to.list
assert_equal [false], @to.in_list_entry
assert_equal "\n", @to.res.join
end
def accept_list_start_lalpha
assert_equal [:LALPHA], @to.list
assert_equal [false], @to.in_list_entry
assert_equal "\n", @to.res.join
end
def accept_list_start_note
assert_equal [:NOTE], @to.list
assert_equal [false], @to.in_list_entry
assert_equal "\n", @to.res.join
end
def accept_list_start_number
assert_equal [:NUMBER], @to.list
assert_equal [false], @to.in_list_entry
assert_equal "\n", @to.res.join
end
def accept_list_start_ualpha
assert_equal [:UALPHA], @to.list
assert_equal [false], @to.in_list_entry
assert_equal "\n", @to.res.join
end
def accept_paragraph
assert_equal "\nhi\n \n", @to.res.join
end
def accept_raw
raw = <<-RAW.rstrip
RAW
assert_equal raw, @to.res.join
end
def accept_rule
assert_equal ' ', @to.res.join
end
def accept_verbatim
assert_equal "\n hi\n world\n \n", @to.res.join
end
def end_accepting
assert_equal 'hi', @to.end_accepting
end
def start_accepting
assert_equal [], @to.res
assert_equal [], @to.in_list_entry
assert_equal [], @to.list
end
def test_list_verbatim
str = "* one\n verb1\n verb2\n* two\n"
expected = <<-EXPECTED
EXPECTED
assert_equal expected, @m.convert(str, @to)
end
def test_tt_formatting
assert_equal "\n-- — cats' cats’\n \n",
util_format("-- -- cats' cats'")
assert_equal "\n—\n \n", util_format("--")
end
def test_convert_string_fancy
#
# The HTML typesetting is broken in a number of ways, but I have fixed
# the most glaring issues for single and double quotes. Note that
# "strange" symbols (periods or dashes) need to be at the end of the
# test case strings in order to suppress cross-references.
#
assert_equal "\n“cats”.\n \n", util_format("\"cats\".")
assert_equal "\n‘cats’.\n \n", util_format("\'cats\'.")
assert_equal "\ncat’s-\n \n", util_format("cat\'s-")
end
def util_paragraph(text)
RDoc::Markup::Paragraph.new text
end
def util_format(text)
paragraph = util_paragraph text
@to.start_accepting
@to.accept_paragraph paragraph
@to.end_accepting
end
end
|