summaryrefslogtreecommitdiff
path: root/test/rdoc/test_rdoc_markdown.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-10-06 13:10:31 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-10-06 23:14:29 +0900
commita19bf47d03b51b339688c865c35bff0c0d2be6c1 (patch)
tree2f78e30c2f5546f7fc19bbc42a9d048f31c75857 /test/rdoc/test_rdoc_markdown.rb
parent76bae60d9b967415c5930c2c5906e14c8362a6dd (diff)
[ruby/rdoc] Allow trailing pipes to be ommitted
https://github.com/ruby/rdoc/commit/1318048877
Diffstat (limited to 'test/rdoc/test_rdoc_markdown.rb')
-rw-r--r--test/rdoc/test_rdoc_markdown.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_markdown.rb b/test/rdoc/test_rdoc_markdown.rb
index ca76c34f43..4c45794343 100644
--- a/test/rdoc/test_rdoc_markdown.rb
+++ b/test/rdoc/test_rdoc_markdown.rb
@@ -1062,6 +1062,25 @@ 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
+ MD
+
+ head = %w[Cmd Returns Meaning]
+ align = [nil, nil, nil]
+ body = [
+ ['"b"', 'boolean', 'True if file1 is a block device'],
+ ['"c"', 'boolean', 'True if file1 is a character device'],
+ ]
+ expected = doc(@RM::Table.new(head, align, body))
+
+ assert_equal expected, doc
+ end
+
def parse text
@parser.parse text
end