aboutsummaryrefslogtreecommitdiffstats
path: root/test/rdoc/test_rdoc_tom_doc.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-27 01:30:18 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-27 01:30:18 +0000
commit95e213d3542034e0fd2613de6990a7ddfe5718ca (patch)
tree76ec64fccb338dbcbc4d3f07c2f494ef9b7fe1ff /test/rdoc/test_rdoc_tom_doc.rb
parent41fb243684f60e231fc77ec54752fe4e844523d5 (diff)
downloadruby-95e213d3542034e0fd2613de6990a7ddfe5718ca.tar.gz
Merge rdoc-6.1.0.beta1.
* https://github.com/ruby/rdoc/compare/v6.0.4...v6.1.0.beta1 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc/test_rdoc_tom_doc.rb')
-rw-r--r--test/rdoc/test_rdoc_tom_doc.rb60
1 files changed, 59 insertions, 1 deletions
diff --git a/test/rdoc/test_rdoc_tom_doc.rb b/test/rdoc/test_rdoc_tom_doc.rb
index 6a6822d50d..27a3e6f178 100644
--- a/test/rdoc/test_rdoc_tom_doc.rb
+++ b/test/rdoc/test_rdoc_tom_doc.rb
@@ -301,6 +301,44 @@ Returns another thing
assert_equal expected, @TD.parse(text)
end
+ def test_parse_returns_with_raises
+ text = <<-TEXT
+Do some stuff
+
+Returns a thing
+Raises ArgumentError when stuff
+Raises StandardError when stuff
+ TEXT
+ expected =
+ doc(
+ para('Do some stuff'),
+ blank_line,
+ head(3, 'Returns'),
+ blank_line,
+ para('Returns a thing'),
+ para('Raises ArgumentError when stuff'),
+ para('Raises StandardError when stuff'))
+
+ assert_equal expected, @TD.parse(text)
+ end
+
+ def test_parse_raises_without_returns
+ text = <<-TEXT
+Do some stuff
+
+Raises ArgumentError when stuff
+ TEXT
+ expected =
+ doc(
+ para('Do some stuff'),
+ blank_line,
+ head(3, 'Returns'),
+ blank_line,
+ para('Raises ArgumentError when stuff'))
+
+ assert_equal expected, @TD.parse(text)
+ end
+
def test_parse_returns_multiline
text = <<-TEXT
Do some stuff
@@ -320,6 +358,27 @@ Returns a thing
assert_equal expected, @TD.parse(text)
end
+ def test_parse_returns_multiline_and_raises
+ text = <<-TEXT
+Do some stuff
+
+Returns a thing
+ that is multiline
+Raises ArgumentError
+ TEXT
+
+ expected =
+ doc(
+ para('Do some stuff'),
+ blank_line,
+ head(3, 'Returns'),
+ blank_line,
+ para('Returns a thing', ' ', 'that is multiline'),
+ para('Raises ArgumentError'))
+
+ assert_equal expected, @TD.parse(text)
+ end
+
def test_parse_signature
text = <<-TEXT
Do some stuff
@@ -518,4 +577,3 @@ Returns a thing
end
end
-