diff options
Diffstat (limited to 'test/rdoc/test_rdoc_markdown.rb')
-rw-r--r-- | test/rdoc/test_rdoc_markdown.rb | 46 |
1 files changed, 42 insertions, 4 deletions
diff --git a/test/rdoc/test_rdoc_markdown.rb b/test/rdoc/test_rdoc_markdown.rb index ad53e9473c..31d5b068f9 100644 --- a/test/rdoc/test_rdoc_markdown.rb +++ b/test/rdoc/test_rdoc_markdown.rb @@ -2,8 +2,8 @@ # frozen_string_literal: true require_relative 'helper' -require 'rdoc/markup/block_quote' -require 'rdoc/markdown' +require_relative '../../lib/rdoc/markup/block_quote' +require_relative '../../lib/rdoc/markdown' class TestRDocMarkdown < RDoc::TestCase @@ -305,6 +305,25 @@ that also extends to two lines assert_equal expected, doc end + def test_parse_definition_list_rich_label + doc = parse <<-MD +`one` +: This is a definition + +**two** +: This is another definition + MD + + expected = doc( + list(:NOTE, + item(%w[<code>one</code>], + para("This is a definition")), + item(%w[*two*], + para("This is another definition")))) + + assert_equal expected, doc + end + def test_parse_definition_list_no @parser.definition_lists = false @@ -761,7 +780,6 @@ with inline notes^[like this] and an extra note.[^2] [^1]: With a footnote - [^2]: Which should be numbered correctly MD @@ -1063,9 +1081,29 @@ and an extra note.[^2] assert_equal expected, doc end + def test_gfm_table_2 + doc = parse <<~'MD' + | Cmd | Returns | Meaning + ----- | :-----: | ------- + |"b" | boolean | True if file1 is a block device + "c" | boolean | True if file1 is a character device + |"\|" | boolean | escaped bar \| test + MD + + head = %w[Cmd Returns Meaning] + align = [nil, :center, nil] + body = [ + ['"b"', 'boolean', 'True if file1 is a block device'], + ['"c"', 'boolean', 'True if file1 is a character device'], + ['"|"', 'boolean', 'escaped bar | test'], + ] + expected = doc(@RM::Table.new(head, align, body)) + + assert_equal expected, doc + end + def parse text @parser.parse text end end - |