rdoc 3.12.2 → 4.0.0.preview2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rdoc might be problematic. Click here for more details.
- checksums.yaml +6 -6
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.autotest +3 -2
- data/DEVELOPERS.rdoc +53 -0
- data/History.rdoc +159 -25
- data/LEGAL.rdoc +12 -0
- data/Manifest.txt +56 -3
- data/README.rdoc +87 -19
- data/Rakefile +11 -2
- data/TODO.rdoc +20 -13
- data/bin/rdoc +4 -0
- data/lib/gauntlet_rdoc.rb +1 -1
- data/lib/rdoc.rb +32 -71
- data/lib/rdoc/any_method.rb +75 -21
- data/lib/rdoc/attr.rb +49 -10
- data/lib/rdoc/class_module.rb +182 -32
- data/lib/rdoc/code_object.rb +54 -12
- data/lib/rdoc/comment.rb +8 -1
- data/lib/rdoc/constant.rb +100 -6
- data/lib/rdoc/context.rb +93 -41
- data/lib/rdoc/context/section.rb +143 -28
- data/lib/rdoc/cross_reference.rb +58 -50
- data/lib/rdoc/encoding.rb +34 -29
- data/lib/rdoc/erb_partial.rb +18 -0
- data/lib/rdoc/extend.rb +117 -0
- data/lib/rdoc/generator.rb +11 -6
- data/lib/rdoc/generator/darkfish.rb +250 -62
- data/lib/rdoc/generator/json_index.rb +20 -12
- data/lib/rdoc/generator/markup.rb +10 -12
- data/lib/rdoc/generator/ri.rb +7 -60
- data/lib/rdoc/generator/template/darkfish/_head.rhtml +7 -7
- data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +16 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +1 -1
- data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +14 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +1 -1
- data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +13 -0
- data/lib/rdoc/generator/template/darkfish/class.rhtml +15 -1
- data/lib/rdoc/generator/template/darkfish/images/arrow_up.png +0 -0
- data/lib/rdoc/generator/template/darkfish/index.rhtml +3 -3
- data/lib/rdoc/generator/template/darkfish/js/darkfish.js +7 -9
- data/lib/rdoc/generator/template/darkfish/page.rhtml +2 -0
- data/lib/rdoc/generator/template/darkfish/rdoc.css +31 -0
- data/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +18 -0
- data/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +37 -0
- data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +3 -3
- data/lib/rdoc/include.rb +12 -3
- data/lib/rdoc/markdown.kpeg +1186 -0
- data/lib/rdoc/markdown.rb +16336 -0
- data/lib/rdoc/markdown/entities.rb +2128 -0
- data/lib/rdoc/markdown/literals_1_8.kpeg +18 -0
- data/lib/rdoc/markdown/literals_1_8.rb +454 -0
- data/lib/rdoc/markdown/literals_1_9.kpeg +22 -0
- data/lib/rdoc/markdown/literals_1_9.rb +417 -0
- data/lib/rdoc/markup.rb +69 -10
- data/lib/rdoc/markup/attr_changer.rb +2 -5
- data/lib/rdoc/markup/attribute_manager.rb +23 -14
- data/lib/rdoc/markup/attributes.rb +70 -0
- data/lib/rdoc/markup/block_quote.rb +14 -0
- data/lib/rdoc/markup/document.rb +20 -4
- data/lib/rdoc/markup/formatter.rb +17 -6
- data/lib/rdoc/markup/formatter_test_case.rb +93 -24
- data/lib/rdoc/markup/hard_break.rb +31 -0
- data/lib/rdoc/markup/heading.rb +1 -1
- data/lib/rdoc/markup/indented_paragraph.rb +14 -0
- data/lib/rdoc/markup/list.rb +23 -4
- data/lib/rdoc/markup/list_item.rb +17 -4
- data/lib/rdoc/markup/paragraph.rb +14 -0
- data/lib/rdoc/markup/parser.rb +107 -60
- data/lib/rdoc/markup/raw.rb +4 -4
- data/lib/rdoc/markup/special.rb +3 -3
- data/lib/rdoc/markup/to_ansi.rb +7 -1
- data/lib/rdoc/markup/to_html.rb +42 -14
- data/lib/rdoc/markup/to_html_crossref.rb +10 -9
- data/lib/rdoc/markup/to_html_snippet.rb +20 -4
- data/lib/rdoc/markup/to_joined_paragraph.rb +68 -0
- data/lib/rdoc/markup/to_label.rb +20 -1
- data/lib/rdoc/markup/to_markdown.rb +134 -0
- data/lib/rdoc/markup/to_rdoc.rb +36 -5
- data/lib/rdoc/markup/to_table_of_contents.rb +6 -1
- data/lib/rdoc/markup/to_tt_only.rb +11 -2
- data/lib/rdoc/markup/verbatim.rb +19 -0
- data/lib/rdoc/method_attr.rb +33 -19
- data/lib/rdoc/normal_class.rb +26 -7
- data/lib/rdoc/normal_module.rb +10 -5
- data/lib/rdoc/options.rb +95 -21
- data/lib/rdoc/parser.rb +6 -2
- data/lib/rdoc/parser/c.rb +212 -97
- data/lib/rdoc/parser/markdown.rb +23 -0
- data/lib/rdoc/parser/ruby.rb +115 -35
- data/lib/rdoc/parser/ruby_tools.rb +8 -3
- data/lib/rdoc/rd.rb +8 -4
- data/lib/rdoc/rd/block_parser.rb +1 -1
- data/lib/rdoc/rd/block_parser.ry +1 -1
- data/lib/rdoc/rdoc.rb +45 -21
- data/lib/rdoc/ri/driver.rb +322 -76
- data/lib/rdoc/ri/paths.rb +90 -31
- data/lib/rdoc/ri/store.rb +2 -353
- data/lib/rdoc/ruby_lex.rb +5 -21
- data/lib/rdoc/ruby_token.rb +2 -3
- data/lib/rdoc/rubygems_hook.rb +21 -9
- data/lib/rdoc/servlet.rb +302 -0
- data/lib/rdoc/stats.rb +28 -20
- data/lib/rdoc/store.rb +881 -0
- data/lib/rdoc/task.rb +2 -1
- data/lib/rdoc/test_case.rb +103 -1
- data/lib/rdoc/text.rb +5 -4
- data/lib/rdoc/tom_doc.rb +17 -16
- data/lib/rdoc/top_level.rb +43 -285
- data/test/MarkdownTest_1.0.3/Amps and angle encoding.text +21 -0
- data/test/MarkdownTest_1.0.3/Auto links.text +13 -0
- data/test/MarkdownTest_1.0.3/Backslash escapes.text +120 -0
- data/test/MarkdownTest_1.0.3/Blockquotes with code blocks.text +11 -0
- data/test/MarkdownTest_1.0.3/Code Blocks.text +14 -0
- data/test/MarkdownTest_1.0.3/Code Spans.text +6 -0
- data/test/MarkdownTest_1.0.3/Hard-wrapped paragraphs with list-like lines.text +8 -0
- data/test/MarkdownTest_1.0.3/Horizontal rules.text +67 -0
- data/test/MarkdownTest_1.0.3/Inline HTML (Advanced).text +15 -0
- data/test/MarkdownTest_1.0.3/Inline HTML (Simple).text +69 -0
- data/test/MarkdownTest_1.0.3/Inline HTML comments.text +13 -0
- data/test/MarkdownTest_1.0.3/Links, inline style.text +12 -0
- data/test/MarkdownTest_1.0.3/Links, reference style.text +71 -0
- data/test/MarkdownTest_1.0.3/Links, shortcut references.text +20 -0
- data/test/MarkdownTest_1.0.3/Literal quotes in titles.text +7 -0
- data/test/MarkdownTest_1.0.3/Markdown Documentation - Basics.text +306 -0
- data/test/MarkdownTest_1.0.3/Markdown Documentation - Syntax.text +888 -0
- data/test/MarkdownTest_1.0.3/Nested blockquotes.text +5 -0
- data/test/MarkdownTest_1.0.3/Ordered and unordered lists.text +131 -0
- data/test/MarkdownTest_1.0.3/Strong and em together.text +7 -0
- data/test/MarkdownTest_1.0.3/Tabs.text +21 -0
- data/test/MarkdownTest_1.0.3/Tidyness.text +5 -0
- data/test/test_attribute_manager.rb +7 -4
- data/test/test_rdoc_any_method.rb +84 -13
- data/test/test_rdoc_attr.rb +59 -9
- data/test/test_rdoc_class_module.rb +670 -73
- data/test/test_rdoc_code_object.rb +21 -1
- data/test/test_rdoc_comment.rb +1 -1
- data/test/test_rdoc_constant.rb +132 -0
- data/test/test_rdoc_context.rb +84 -18
- data/test/test_rdoc_context_section.rb +99 -15
- data/test/test_rdoc_cross_reference.rb +1 -1
- data/test/test_rdoc_encoding.rb +17 -1
- data/test/test_rdoc_extend.rb +94 -0
- data/test/test_rdoc_generator_darkfish.rb +45 -19
- data/test/test_rdoc_generator_json_index.rb +27 -7
- data/test/test_rdoc_generator_markup.rb +3 -3
- data/test/test_rdoc_generator_ri.rb +11 -9
- data/test/test_rdoc_include.rb +12 -0
- data/test/test_rdoc_markdown.rb +977 -0
- data/test/test_rdoc_markdown_test.rb +1891 -0
- data/test/test_rdoc_markup.rb +1 -1
- data/test/test_rdoc_markup_attribute_manager.rb +2 -2
- data/test/test_rdoc_markup_attributes.rb +39 -0
- data/test/test_rdoc_markup_document.rb +16 -1
- data/test/test_rdoc_markup_formatter.rb +7 -4
- data/test/test_rdoc_markup_hard_break.rb +31 -0
- data/test/test_rdoc_markup_indented_paragraph.rb +14 -0
- data/test/test_rdoc_markup_paragraph.rb +15 -1
- data/test/test_rdoc_markup_parser.rb +152 -89
- data/test/test_rdoc_markup_to_ansi.rb +23 -2
- data/test/test_rdoc_markup_to_bs.rb +24 -0
- data/test/test_rdoc_markup_to_html.rb +50 -19
- data/test/test_rdoc_markup_to_html_crossref.rb +23 -5
- data/test/test_rdoc_markup_to_html_snippet.rb +49 -8
- data/test/test_rdoc_markup_to_joined_paragraph.rb +32 -0
- data/test/test_rdoc_markup_to_label.rb +63 -1
- data/test/test_rdoc_markup_to_markdown.rb +352 -0
- data/test/test_rdoc_markup_to_rdoc.rb +22 -2
- data/test/test_rdoc_markup_to_table_of_contents.rb +44 -39
- data/test/test_rdoc_markup_to_tt_only.rb +20 -0
- data/test/test_rdoc_markup_verbatim.rb +13 -0
- data/test/test_rdoc_method_attr.rb +5 -0
- data/test/test_rdoc_normal_class.rb +24 -5
- data/test/test_rdoc_normal_module.rb +1 -1
- data/test/test_rdoc_options.rb +21 -6
- data/test/test_rdoc_parser.rb +24 -0
- data/test/test_rdoc_parser_c.rb +151 -26
- data/test/test_rdoc_parser_markdown.rb +55 -0
- data/test/test_rdoc_parser_rd.rb +2 -2
- data/test/test_rdoc_parser_ruby.rb +468 -109
- data/test/test_rdoc_parser_simple.rb +2 -2
- data/test/test_rdoc_rd_block_parser.rb +0 -4
- data/test/test_rdoc_rdoc.rb +110 -22
- data/test/test_rdoc_ri_driver.rb +415 -80
- data/test/test_rdoc_ri_paths.rb +122 -13
- data/test/test_rdoc_ruby_lex.rb +5 -61
- data/test/test_rdoc_ruby_token.rb +19 -0
- data/test/test_rdoc_rubygems_hook.rb +64 -43
- data/test/test_rdoc_servlet.rb +429 -0
- data/test/test_rdoc_stats.rb +83 -24
- data/test/{test_rdoc_ri_store.rb → test_rdoc_store.rb} +395 -22
- data/test/test_rdoc_task.rb +2 -2
- data/test/test_rdoc_text.rb +37 -11
- data/test/test_rdoc_tom_doc.rb +59 -62
- data/test/test_rdoc_top_level.rb +71 -113
- data/test/xref_test_case.rb +7 -9
- metadata +122 -39
- metadata.gz.sig +0 -0
- data/CVE-2013-0256.rdoc +0 -49
- data/lib/rdoc/markup/attribute.rb +0 -51
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'rdoc/test_case'
|
2
2
|
|
3
|
-
class TestRDocMarkupToLabel < RDoc::
|
3
|
+
class TestRDocMarkupToLabel < RDoc::Markup::FormatterTestCase
|
4
|
+
|
5
|
+
add_visitor_tests
|
4
6
|
|
5
7
|
def setup
|
6
8
|
super
|
@@ -8,6 +10,66 @@ class TestRDocMarkupToLabel < RDoc::TestCase
|
|
8
10
|
@to = RDoc::Markup::ToLabel.new
|
9
11
|
end
|
10
12
|
|
13
|
+
def empty
|
14
|
+
assert_empty @to.res
|
15
|
+
end
|
16
|
+
|
17
|
+
def end_accepting
|
18
|
+
assert_equal %w[hi], @to.res
|
19
|
+
end
|
20
|
+
|
21
|
+
alias accept_blank_line empty
|
22
|
+
alias accept_block_quote empty
|
23
|
+
alias accept_document empty
|
24
|
+
alias accept_heading empty
|
25
|
+
alias accept_heading_1 empty
|
26
|
+
alias accept_heading_2 empty
|
27
|
+
alias accept_heading_3 empty
|
28
|
+
alias accept_heading_4 empty
|
29
|
+
alias accept_heading_b empty
|
30
|
+
alias accept_heading_suppressed_crossref empty
|
31
|
+
alias accept_list_end_bullet empty
|
32
|
+
alias accept_list_end_label empty
|
33
|
+
alias accept_list_end_lalpha empty
|
34
|
+
alias accept_list_end_note empty
|
35
|
+
alias accept_list_end_number empty
|
36
|
+
alias accept_list_end_ualpha empty
|
37
|
+
alias accept_list_item_end_bullet empty
|
38
|
+
alias accept_list_item_end_label empty
|
39
|
+
alias accept_list_item_end_lalpha empty
|
40
|
+
alias accept_list_item_end_note empty
|
41
|
+
alias accept_list_item_end_number empty
|
42
|
+
alias accept_list_item_end_ualpha empty
|
43
|
+
alias accept_list_item_start_bullet empty
|
44
|
+
alias accept_list_item_start_label empty
|
45
|
+
alias accept_list_item_start_lalpha empty
|
46
|
+
alias accept_list_item_start_note empty
|
47
|
+
alias accept_list_item_start_note_2 empty
|
48
|
+
alias accept_list_item_start_note_multi_description empty
|
49
|
+
alias accept_list_item_start_note_multi_label empty
|
50
|
+
alias accept_list_item_start_number empty
|
51
|
+
alias accept_list_item_start_ualpha empty
|
52
|
+
alias accept_list_start_bullet empty
|
53
|
+
alias accept_list_start_label empty
|
54
|
+
alias accept_list_start_lalpha empty
|
55
|
+
alias accept_list_start_note empty
|
56
|
+
alias accept_list_start_number empty
|
57
|
+
alias accept_list_start_ualpha empty
|
58
|
+
alias accept_paragraph empty
|
59
|
+
alias accept_paragraph_b empty
|
60
|
+
alias accept_paragraph_br empty
|
61
|
+
alias accept_paragraph_break empty
|
62
|
+
alias accept_paragraph_i empty
|
63
|
+
alias accept_paragraph_plus empty
|
64
|
+
alias accept_paragraph_star empty
|
65
|
+
alias accept_paragraph_underscore empty
|
66
|
+
alias accept_raw empty
|
67
|
+
alias accept_rule empty
|
68
|
+
alias accept_verbatim empty
|
69
|
+
alias list_nested empty
|
70
|
+
alias list_verbatim empty
|
71
|
+
alias start_accepting empty
|
72
|
+
|
11
73
|
def test_convert_bold
|
12
74
|
assert_equal 'bold', @to.convert('<b>bold</b>')
|
13
75
|
assert_equal 'bold', @to.convert('*bold*')
|
@@ -0,0 +1,352 @@
|
|
1
|
+
require 'rdoc/test_case'
|
2
|
+
|
3
|
+
class TestRDocMarkupToMarkdown < RDoc::Markup::TextFormatterTestCase
|
4
|
+
|
5
|
+
add_visitor_tests
|
6
|
+
add_text_tests
|
7
|
+
|
8
|
+
def setup
|
9
|
+
super
|
10
|
+
|
11
|
+
@to = RDoc::Markup::ToMarkdown.new
|
12
|
+
end
|
13
|
+
|
14
|
+
def accept_blank_line
|
15
|
+
assert_equal "\n", @to.res.join
|
16
|
+
end
|
17
|
+
|
18
|
+
def accept_block_quote
|
19
|
+
assert_equal "> quote\n", @to.res.join
|
20
|
+
end
|
21
|
+
|
22
|
+
def accept_document
|
23
|
+
assert_equal "hello\n", @to.res.join
|
24
|
+
end
|
25
|
+
|
26
|
+
def accept_heading
|
27
|
+
assert_equal "##### Hello\n", @to.res.join
|
28
|
+
end
|
29
|
+
|
30
|
+
def accept_list_end_bullet
|
31
|
+
assert_empty @to.list_index
|
32
|
+
assert_empty @to.list_type
|
33
|
+
assert_empty @to.list_width
|
34
|
+
end
|
35
|
+
|
36
|
+
def accept_list_end_label
|
37
|
+
assert_empty @to.list_index
|
38
|
+
assert_empty @to.list_type
|
39
|
+
assert_empty @to.list_width
|
40
|
+
end
|
41
|
+
|
42
|
+
def accept_list_end_lalpha
|
43
|
+
assert_empty @to.list_index
|
44
|
+
assert_empty @to.list_type
|
45
|
+
assert_empty @to.list_width
|
46
|
+
end
|
47
|
+
|
48
|
+
def accept_list_end_note
|
49
|
+
assert_empty @to.list_index
|
50
|
+
assert_empty @to.list_type
|
51
|
+
assert_empty @to.list_width
|
52
|
+
end
|
53
|
+
|
54
|
+
def accept_list_end_number
|
55
|
+
assert_empty @to.list_index
|
56
|
+
assert_empty @to.list_type
|
57
|
+
assert_empty @to.list_width
|
58
|
+
end
|
59
|
+
|
60
|
+
def accept_list_end_ualpha
|
61
|
+
assert_empty @to.list_index
|
62
|
+
assert_empty @to.list_type
|
63
|
+
assert_empty @to.list_width
|
64
|
+
end
|
65
|
+
|
66
|
+
def accept_list_item_end_bullet
|
67
|
+
assert_equal 0, @to.indent, 'indent'
|
68
|
+
end
|
69
|
+
|
70
|
+
def accept_list_item_end_label
|
71
|
+
assert_equal "cat\n: ", @to.res.join
|
72
|
+
assert_equal 0, @to.indent, 'indent'
|
73
|
+
end
|
74
|
+
|
75
|
+
def accept_list_item_end_lalpha
|
76
|
+
assert_equal 0, @to.indent, 'indent'
|
77
|
+
assert_equal 2, @to.list_index.last
|
78
|
+
end
|
79
|
+
|
80
|
+
def accept_list_item_end_note
|
81
|
+
assert_equal "cat\n: ", @to.res.join
|
82
|
+
assert_equal 0, @to.indent, 'indent'
|
83
|
+
end
|
84
|
+
|
85
|
+
def accept_list_item_end_number
|
86
|
+
assert_equal 0, @to.indent, 'indent'
|
87
|
+
assert_equal 2, @to.list_index.last
|
88
|
+
end
|
89
|
+
|
90
|
+
def accept_list_item_end_ualpha
|
91
|
+
assert_equal 0, @to.indent, 'indent'
|
92
|
+
assert_equal 2, @to.list_index.last
|
93
|
+
end
|
94
|
+
|
95
|
+
def accept_list_item_start_bullet
|
96
|
+
assert_equal [""], @to.res
|
97
|
+
assert_equal '* ', @to.prefix
|
98
|
+
end
|
99
|
+
|
100
|
+
def accept_list_item_start_label
|
101
|
+
assert_equal [""], @to.res
|
102
|
+
assert_equal "cat\n: ", @to.prefix
|
103
|
+
|
104
|
+
assert_equal 4, @to.indent
|
105
|
+
end
|
106
|
+
|
107
|
+
def accept_list_item_start_lalpha
|
108
|
+
assert_equal [""], @to.res
|
109
|
+
assert_equal '1. ', @to.prefix
|
110
|
+
|
111
|
+
assert_equal 1, @to.list_index.last
|
112
|
+
assert_equal 4, @to.indent
|
113
|
+
end
|
114
|
+
|
115
|
+
def accept_list_item_start_note
|
116
|
+
assert_equal [""], @to.res
|
117
|
+
assert_equal "cat\n: ", @to.prefix
|
118
|
+
|
119
|
+
assert_equal 4, @to.indent
|
120
|
+
end
|
121
|
+
|
122
|
+
def accept_list_item_start_number
|
123
|
+
assert_equal [""], @to.res
|
124
|
+
assert_equal '1. ', @to.prefix
|
125
|
+
|
126
|
+
assert_equal 1, @to.list_index.last
|
127
|
+
assert_equal 4, @to.indent
|
128
|
+
end
|
129
|
+
|
130
|
+
def accept_list_item_start_ualpha
|
131
|
+
assert_equal [""], @to.res
|
132
|
+
assert_equal '1. ', @to.prefix
|
133
|
+
|
134
|
+
assert_equal 1, @to.list_index.last
|
135
|
+
assert_equal 4, @to.indent
|
136
|
+
end
|
137
|
+
|
138
|
+
def accept_list_start_bullet
|
139
|
+
assert_equal "", @to.res.join
|
140
|
+
assert_equal [nil], @to.list_index
|
141
|
+
assert_equal [:BULLET], @to.list_type
|
142
|
+
assert_equal [4], @to.list_width
|
143
|
+
end
|
144
|
+
|
145
|
+
def accept_list_start_label
|
146
|
+
assert_equal "", @to.res.join
|
147
|
+
assert_equal [nil], @to.list_index
|
148
|
+
assert_equal [:LABEL], @to.list_type
|
149
|
+
assert_equal [4], @to.list_width
|
150
|
+
end
|
151
|
+
|
152
|
+
def accept_list_start_lalpha
|
153
|
+
assert_equal "", @to.res.join
|
154
|
+
assert_equal [1], @to.list_index
|
155
|
+
assert_equal [:LALPHA], @to.list_type
|
156
|
+
assert_equal [4], @to.list_width
|
157
|
+
end
|
158
|
+
|
159
|
+
def accept_list_start_note
|
160
|
+
assert_equal "", @to.res.join
|
161
|
+
assert_equal [nil], @to.list_index
|
162
|
+
assert_equal [:NOTE], @to.list_type
|
163
|
+
assert_equal [4], @to.list_width
|
164
|
+
end
|
165
|
+
|
166
|
+
def accept_list_start_number
|
167
|
+
assert_equal "", @to.res.join
|
168
|
+
assert_equal [1], @to.list_index
|
169
|
+
assert_equal [:NUMBER], @to.list_type
|
170
|
+
assert_equal [4], @to.list_width
|
171
|
+
end
|
172
|
+
|
173
|
+
def accept_list_start_ualpha
|
174
|
+
assert_equal "", @to.res.join
|
175
|
+
assert_equal [1], @to.list_index
|
176
|
+
assert_equal [:UALPHA], @to.list_type
|
177
|
+
assert_equal [4], @to.list_width
|
178
|
+
end
|
179
|
+
|
180
|
+
def accept_paragraph
|
181
|
+
assert_equal "hi\n", @to.res.join
|
182
|
+
end
|
183
|
+
|
184
|
+
def accept_raw
|
185
|
+
raw = <<-RAW.rstrip
|
186
|
+
<table>
|
187
|
+
<tr><th>Name<th>Count
|
188
|
+
<tr><td>a<td>1
|
189
|
+
<tr><td>b<td>2
|
190
|
+
</table>
|
191
|
+
RAW
|
192
|
+
|
193
|
+
assert_equal raw, @to.res.join
|
194
|
+
end
|
195
|
+
|
196
|
+
def accept_rule
|
197
|
+
assert_equal "---\n", @to.res.join
|
198
|
+
end
|
199
|
+
|
200
|
+
def accept_verbatim
|
201
|
+
assert_equal " hi\n world\n\n", @to.res.join
|
202
|
+
end
|
203
|
+
|
204
|
+
def end_accepting
|
205
|
+
assert_equal "hi", @to.end_accepting
|
206
|
+
end
|
207
|
+
|
208
|
+
def start_accepting
|
209
|
+
assert_equal 0, @to.indent
|
210
|
+
assert_equal [""], @to.res
|
211
|
+
assert_empty @to.list_index
|
212
|
+
assert_empty @to.list_type
|
213
|
+
assert_empty @to.list_width
|
214
|
+
end
|
215
|
+
|
216
|
+
def accept_heading_1
|
217
|
+
assert_equal "# Hello\n", @to.end_accepting
|
218
|
+
end
|
219
|
+
|
220
|
+
def accept_heading_2
|
221
|
+
assert_equal "## Hello\n", @to.end_accepting
|
222
|
+
end
|
223
|
+
|
224
|
+
def accept_heading_3
|
225
|
+
assert_equal "### Hello\n", @to.end_accepting
|
226
|
+
end
|
227
|
+
|
228
|
+
def accept_heading_4
|
229
|
+
assert_equal "#### Hello\n", @to.end_accepting
|
230
|
+
end
|
231
|
+
|
232
|
+
def accept_heading_indent
|
233
|
+
assert_equal " # Hello\n", @to.end_accepting
|
234
|
+
end
|
235
|
+
|
236
|
+
def accept_heading_b
|
237
|
+
assert_equal "# **Hello**\n", @to.end_accepting
|
238
|
+
end
|
239
|
+
|
240
|
+
def accept_heading_suppressed_crossref
|
241
|
+
assert_equal "# Hello\n", @to.end_accepting
|
242
|
+
end
|
243
|
+
|
244
|
+
def accept_list_item_start_note_2
|
245
|
+
assert_equal "`teletype`\n: teletype description\n\n", @to.res.join
|
246
|
+
end
|
247
|
+
|
248
|
+
def accept_list_item_start_note_multi_description
|
249
|
+
assert_equal "label\n: description one\n\n: description two\n\n",
|
250
|
+
@to.res.join
|
251
|
+
end
|
252
|
+
|
253
|
+
def accept_list_item_start_note_multi_label
|
254
|
+
assert_equal "one\ntwo\n: two headers\n\n", @to.res.join
|
255
|
+
end
|
256
|
+
|
257
|
+
def accept_paragraph_b
|
258
|
+
assert_equal "reg **bold words** reg\n", @to.end_accepting
|
259
|
+
end
|
260
|
+
|
261
|
+
def accept_paragraph_br
|
262
|
+
assert_equal "one \ntwo\n", @to.end_accepting
|
263
|
+
end
|
264
|
+
|
265
|
+
def accept_paragraph_break
|
266
|
+
assert_equal "hello \nworld\n", @to.end_accepting
|
267
|
+
end
|
268
|
+
|
269
|
+
def accept_paragraph_i
|
270
|
+
assert_equal "reg *italic words* reg\n", @to.end_accepting
|
271
|
+
end
|
272
|
+
|
273
|
+
def accept_paragraph_indent
|
274
|
+
expected = <<-EXPECTED
|
275
|
+
words words words words words words words words words words words words
|
276
|
+
words words words words words words words words words words words words
|
277
|
+
words words words words words words
|
278
|
+
EXPECTED
|
279
|
+
|
280
|
+
assert_equal expected, @to.end_accepting
|
281
|
+
end
|
282
|
+
|
283
|
+
def accept_paragraph_plus
|
284
|
+
assert_equal "reg `teletype` reg\n", @to.end_accepting
|
285
|
+
end
|
286
|
+
|
287
|
+
def accept_paragraph_star
|
288
|
+
assert_equal "reg **bold** reg\n", @to.end_accepting
|
289
|
+
end
|
290
|
+
|
291
|
+
def accept_paragraph_underscore
|
292
|
+
assert_equal "reg *italic* reg\n", @to.end_accepting
|
293
|
+
end
|
294
|
+
|
295
|
+
def accept_paragraph_wrap
|
296
|
+
expected = <<-EXPECTED
|
297
|
+
words words words words words words words words words words words words words
|
298
|
+
words words words words words words words words words words words words words
|
299
|
+
words words words words
|
300
|
+
EXPECTED
|
301
|
+
|
302
|
+
assert_equal expected, @to.end_accepting
|
303
|
+
end
|
304
|
+
|
305
|
+
def accept_rule_indent
|
306
|
+
assert_equal " ---\n", @to.end_accepting
|
307
|
+
end
|
308
|
+
|
309
|
+
def accept_verbatim_indent
|
310
|
+
assert_equal " hi\n world\n\n", @to.end_accepting
|
311
|
+
end
|
312
|
+
|
313
|
+
def accept_verbatim_big_indent
|
314
|
+
assert_equal " hi\n world\n\n", @to.end_accepting
|
315
|
+
end
|
316
|
+
|
317
|
+
def list_nested
|
318
|
+
expected = <<-EXPECTED
|
319
|
+
* l1
|
320
|
+
* l1.1
|
321
|
+
|
322
|
+
* l2
|
323
|
+
|
324
|
+
EXPECTED
|
325
|
+
|
326
|
+
assert_equal expected, @to.end_accepting
|
327
|
+
end
|
328
|
+
|
329
|
+
def list_verbatim
|
330
|
+
expected = <<-EXPECTED # HACK overblown
|
331
|
+
* list stuff
|
332
|
+
|
333
|
+
* list
|
334
|
+
with
|
335
|
+
|
336
|
+
second
|
337
|
+
|
338
|
+
1. indented
|
339
|
+
2. numbered
|
340
|
+
|
341
|
+
third
|
342
|
+
|
343
|
+
* second
|
344
|
+
|
345
|
+
|
346
|
+
EXPECTED
|
347
|
+
|
348
|
+
assert_equal expected, @to.end_accepting
|
349
|
+
end
|
350
|
+
|
351
|
+
end
|
352
|
+
|
@@ -15,6 +15,10 @@ class TestRDocMarkupToRDoc < RDoc::Markup::TextFormatterTestCase
|
|
15
15
|
assert_equal "\n", @to.res.join
|
16
16
|
end
|
17
17
|
|
18
|
+
def accept_block_quote
|
19
|
+
assert_equal "> quote\n", @to.res.join
|
20
|
+
end
|
21
|
+
|
18
22
|
def accept_document
|
19
23
|
assert_equal "hello\n", @to.res.join
|
20
24
|
end
|
@@ -241,10 +245,27 @@ class TestRDocMarkupToRDoc < RDoc::Markup::TextFormatterTestCase
|
|
241
245
|
assert_equal "<tt>teletype</tt>:\n teletype description\n\n", @to.res.join
|
242
246
|
end
|
243
247
|
|
248
|
+
def accept_list_item_start_note_multi_description
|
249
|
+
assert_equal "label:\n description one\n\n description two\n\n",
|
250
|
+
@to.res.join
|
251
|
+
end
|
252
|
+
|
253
|
+
def accept_list_item_start_note_multi_label
|
254
|
+
assert_equal "one\ntwo:\n two headers\n\n", @to.res.join
|
255
|
+
end
|
256
|
+
|
244
257
|
def accept_paragraph_b
|
245
258
|
assert_equal "reg <b>bold words</b> reg\n", @to.end_accepting
|
246
259
|
end
|
247
260
|
|
261
|
+
def accept_paragraph_br
|
262
|
+
assert_equal "one\ntwo\n", @to.end_accepting
|
263
|
+
end
|
264
|
+
|
265
|
+
def accept_paragraph_break
|
266
|
+
assert_equal "hello\nworld\n", @to.end_accepting
|
267
|
+
end
|
268
|
+
|
248
269
|
def accept_paragraph_i
|
249
270
|
assert_equal "reg <em>italic words</em> reg\n", @to.end_accepting
|
250
271
|
end
|
@@ -333,8 +354,7 @@ bar ::
|
|
333
354
|
NOTE_LIST
|
334
355
|
|
335
356
|
expected = <<-EXPECTED
|
336
|
-
|
337
|
-
foo:
|
357
|
+
foo
|
338
358
|
bar:
|
339
359
|
hi
|
340
360
|
|