summaryrefslogtreecommitdiff
path: root/test/rdoc/test_rdoc_tom_doc.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rdoc/test_rdoc_tom_doc.rb')
-rw-r--r--test/rdoc/test_rdoc_tom_doc.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_tom_doc.rb b/test/rdoc/test_rdoc_tom_doc.rb
index 08f30d1e53..b22411f89f 100644
--- a/test/rdoc/test_rdoc_tom_doc.rb
+++ b/test/rdoc/test_rdoc_tom_doc.rb
@@ -156,6 +156,24 @@ description - arguments description
assert_equal expected, @TD.parse(text)
end
+ def test_parse_arguments_array
+ text = <<-TEXT
+Create new Arg object.
+
+names[] - names of arguments
+ TEXT
+
+ expected =
+ doc(
+ para('Create new Arg object.'),
+ blank_line,
+ list(:NOTE,
+ item(%w[names[]],
+ para('names of arguments'))))
+
+ assert_equal expected, @TD.parse(text)
+ end
+
def test_parse_arguments_multiline
text = <<-TEXT
Do some stuff
@@ -343,6 +361,25 @@ description - arguments description
assert_equal expected, @td.tokens
end
+ def test_tokenize_arguments_array
+ @td.tokenize <<-TEXT
+Create new Arg object.
+
+names[stuff] - names of arguments
+ TEXT
+
+ expected = [
+ [:TEXT, "Create new Arg object.", 0, 0],
+ [:NEWLINE, "\n", 22, 0],
+ [:NEWLINE, "\n", 0, 1],
+ [:NOTE, "names[stuff]", 0, 2],
+ [:TEXT, "names of arguments", 15, 2],
+ [:NEWLINE, "\n", 33, 2],
+ ]
+
+ assert_equal expected, @td.tokens
+ end
+
def test_tokenize_arguments_multiline
@td.tokenize <<-TEXT
Do some stuff