1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/rdoc: Update to RDoc 4.1.0.preview.1

RDoc 4.1.0 contains a number of enhancements including a new default
  style and accessibility support.  You can see the changelog here:

  https://github.com/rdoc/rdoc/blob/v4.1.0.preview.1/History.rdoc

* test/rdoc:  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2013-09-18 23:33:36 +00:00
parent fed428007c
commit df7dac9174
118 changed files with 5394 additions and 3600 deletions

View file

@ -11,13 +11,6 @@ class TestRDocTomDoc < RDoc::TestCase
@td = @TD.new
end
def mu_pp obj
s = ''
s = PP.pp obj, s
s = s.force_encoding Encoding.default_external if defined? Encoding
s.chomp
end
def test_class_add_post_processor
RDoc::TomDoc.add_post_processor
@ -135,6 +128,17 @@ here - something
assert_equal expected, @TD.parse(text)
end
def test_parse_multiline_paragraph
text = "Public: Do some stuff\n"
text << "On a new line\n"
expected =
doc(
para('Do some stuff', ' ', 'On a new line'))
assert_equal expected, @TD.parse(text)
end
def test_parse_arguments
text = <<-TEXT
Create new Arg object.
@ -188,7 +192,7 @@ foo - A comment goes here
blank_line,
list(:NOTE,
item(%w[foo],
para('A comment goes here', 'and is more than one line'))))
para('A comment goes here', ' ', 'and is more than one line'))))
assert_equal expected, @TD.parse(text)
end
@ -279,13 +283,19 @@ Signature
Do some stuff
Returns a thing
Returns another thing
TEXT
expected =
@RM::Document.new(
@RM::Paragraph.new('Do some stuff'),
@RM::BlankLine.new,
@RM::Paragraph.new('Returns a thing'))
doc(
para('Do some stuff'),
blank_line,
head(3, 'Returns'),
blank_line,
para('Returns a thing'),
blank_line,
para('Returns another thing'))
assert_equal expected, @TD.parse(text)
end
@ -299,10 +309,12 @@ Returns a thing
TEXT
expected =
@RM::Document.new(
@RM::Paragraph.new('Do some stuff'),
@RM::BlankLine.new,
@RM::Paragraph.new('Returns a thing', 'that is multiline'))
doc(
para('Do some stuff'),
blank_line,
head(3, 'Returns'),
blank_line,
para('Returns a thing', ' ', 'that is multiline'))
assert_equal expected, @TD.parse(text)
end
@ -338,6 +350,22 @@ Signature
assert_equal expected, @td.tokens
end
def test_tokenize_multiline_paragraph
text = "Public: Do some stuff\n"
text << "On a new line\n"
@td.tokenize text
expected = [
[:TEXT, "Do some stuff", 0, 0],
[:NEWLINE, "\n", 13, 0],
[:TEXT, "On a new line", 0, 1],
[:NEWLINE, "\n", 13, 1]
]
assert_equal expected, @td.tokens
end
def test_tokenize_arguments
@td.tokenize <<-TEXT
Create new Arg object.