rdoc 4.3.0 → 5.0.0.beta1
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 +4 -4
- data/.gitignore +13 -0
- data/.travis.yml +23 -0
- data/CONTRIBUTING.rdoc +4 -3
- data/Gemfile +3 -0
- data/History.rdoc +15 -4
- data/LEGAL.rdoc +2 -2
- data/README.rdoc +1 -0
- data/Rakefile +41 -79
- data/bin/console +7 -0
- data/bin/setup +6 -0
- data/{bin → exe}/rdoc +0 -0
- data/{bin → exe}/ri +0 -0
- data/lib/rdoc.rb +2 -1
- data/lib/rdoc/alias.rb +1 -0
- data/lib/rdoc/anon_class.rb +1 -0
- data/lib/rdoc/any_method.rb +1 -0
- data/lib/rdoc/attr.rb +1 -0
- data/lib/rdoc/class_module.rb +1 -0
- data/lib/rdoc/code_object.rb +1 -0
- data/lib/rdoc/code_objects.rb +1 -0
- data/lib/rdoc/comment.rb +1 -0
- data/lib/rdoc/constant.rb +1 -0
- data/lib/rdoc/context.rb +4 -1
- data/lib/rdoc/context/section.rb +7 -0
- data/lib/rdoc/cross_reference.rb +1 -0
- data/lib/rdoc/encoding.rb +14 -0
- data/lib/rdoc/erb_partial.rb +1 -0
- data/lib/rdoc/erbio.rb +1 -0
- data/lib/rdoc/extend.rb +1 -0
- data/lib/rdoc/generator.rb +1 -0
- data/lib/rdoc/generator/darkfish.rb +1 -0
- data/lib/rdoc/generator/json_index.rb +1 -0
- data/lib/rdoc/generator/markup.rb +1 -0
- data/lib/rdoc/generator/pot.rb +1 -0
- data/lib/rdoc/generator/pot/message_extractor.rb +1 -0
- data/lib/rdoc/generator/pot/po.rb +1 -0
- data/lib/rdoc/generator/pot/po_entry.rb +1 -0
- data/lib/rdoc/generator/ri.rb +1 -0
- data/lib/rdoc/generator/template/darkfish/_head.rhtml +2 -1
- data/lib/rdoc/generator/template/darkfish/css/fonts.css +6 -6
- data/lib/rdoc/generator/template/darkfish/js/darkfish.js +7 -7
- data/lib/rdoc/generator/template/json_index/js/searcher.js +1 -0
- data/lib/rdoc/ghost_method.rb +1 -0
- data/lib/rdoc/i18n.rb +1 -0
- data/lib/rdoc/i18n/locale.rb +1 -0
- data/lib/rdoc/i18n/text.rb +1 -0
- data/lib/rdoc/include.rb +1 -0
- data/lib/rdoc/known_classes.rb +1 -0
- data/lib/rdoc/markdown.kpeg +2 -6
- data/lib/rdoc/markdown.rb +2 -6
- data/lib/rdoc/markdown/entities.rb +1 -0
- data/lib/rdoc/markdown/{literals_1_9.kpeg → literals.kpeg} +0 -0
- data/lib/rdoc/markdown/{literals_1_9.rb → literals.rb} +1 -4
- data/lib/rdoc/markup.rb +1 -0
- data/lib/rdoc/markup/attr_changer.rb +1 -0
- data/lib/rdoc/markup/attr_span.rb +1 -0
- data/lib/rdoc/markup/attribute_manager.rb +1 -0
- data/lib/rdoc/markup/attributes.rb +1 -0
- data/lib/rdoc/markup/blank_line.rb +1 -0
- data/lib/rdoc/markup/block_quote.rb +1 -0
- data/lib/rdoc/markup/document.rb +1 -0
- data/lib/rdoc/markup/formatter.rb +1 -0
- data/lib/rdoc/markup/formatter_test_case.rb +1 -4
- data/lib/rdoc/markup/hard_break.rb +1 -0
- data/lib/rdoc/markup/heading.rb +1 -0
- data/lib/rdoc/markup/include.rb +1 -0
- data/lib/rdoc/markup/indented_paragraph.rb +1 -0
- data/lib/rdoc/markup/inline.rb +1 -0
- data/lib/rdoc/markup/list.rb +1 -0
- data/lib/rdoc/markup/list_item.rb +1 -0
- data/lib/rdoc/markup/paragraph.rb +1 -0
- data/lib/rdoc/markup/parser.rb +1 -0
- data/lib/rdoc/markup/pre_process.rb +1 -0
- data/lib/rdoc/markup/raw.rb +1 -0
- data/lib/rdoc/markup/rule.rb +1 -0
- data/lib/rdoc/markup/special.rb +1 -0
- data/lib/rdoc/markup/text_formatter_test_case.rb +1 -0
- data/lib/rdoc/markup/to_ansi.rb +1 -0
- data/lib/rdoc/markup/to_bs.rb +1 -0
- data/lib/rdoc/markup/to_html.rb +1 -0
- data/lib/rdoc/markup/to_html_crossref.rb +1 -0
- data/lib/rdoc/markup/to_html_snippet.rb +1 -0
- data/lib/rdoc/markup/to_joined_paragraph.rb +1 -0
- data/lib/rdoc/markup/to_label.rb +1 -0
- data/lib/rdoc/markup/to_markdown.rb +1 -0
- data/lib/rdoc/markup/to_rdoc.rb +1 -0
- data/lib/rdoc/markup/to_table_of_contents.rb +1 -0
- data/lib/rdoc/markup/to_test.rb +1 -0
- data/lib/rdoc/markup/to_tt_only.rb +1 -0
- data/lib/rdoc/markup/verbatim.rb +1 -0
- data/lib/rdoc/meta_method.rb +1 -0
- data/lib/rdoc/method_attr.rb +1 -0
- data/lib/rdoc/mixin.rb +1 -0
- data/lib/rdoc/normal_class.rb +1 -0
- data/lib/rdoc/normal_module.rb +1 -0
- data/lib/rdoc/options.rb +1 -0
- data/lib/rdoc/parser.rb +1 -0
- data/lib/rdoc/parser/c.rb +76 -33
- data/lib/rdoc/parser/changelog.rb +7 -1
- data/lib/rdoc/parser/markdown.rb +1 -0
- data/lib/rdoc/parser/rd.rb +1 -0
- data/lib/rdoc/parser/ruby.rb +1 -0
- data/lib/rdoc/parser/ruby_tools.rb +1 -0
- data/lib/rdoc/parser/simple.rb +1 -0
- data/lib/rdoc/parser/text.rb +1 -0
- data/lib/rdoc/rd.rb +1 -0
- data/lib/rdoc/rd/inline.rb +1 -0
- data/lib/rdoc/rdoc.rb +2 -1
- data/lib/rdoc/require.rb +1 -0
- data/lib/rdoc/ri.rb +1 -0
- data/lib/rdoc/ri/driver.rb +5 -19
- data/lib/rdoc/ri/formatter.rb +1 -0
- data/lib/rdoc/ri/paths.rb +1 -0
- data/lib/rdoc/ri/store.rb +1 -0
- data/lib/rdoc/ri/task.rb +72 -0
- data/lib/rdoc/ruby_lex.rb +11 -17
- data/lib/rdoc/ruby_token.rb +1 -0
- data/lib/rdoc/rubygems_hook.rb +1 -0
- data/lib/rdoc/servlet.rb +4 -3
- data/lib/rdoc/single_class.rb +1 -0
- data/lib/rdoc/stats.rb +1 -0
- data/lib/rdoc/stats/normal.rb +1 -0
- data/lib/rdoc/stats/quiet.rb +1 -0
- data/lib/rdoc/stats/verbose.rb +1 -0
- data/lib/rdoc/store.rb +3 -9
- data/lib/rdoc/task.rb +1 -0
- data/lib/rdoc/test_case.rb +1 -10
- data/lib/rdoc/text.rb +1 -0
- data/lib/rdoc/token_stream.rb +1 -0
- data/lib/rdoc/tom_doc.rb +1 -0
- data/lib/rdoc/top_level.rb +1 -0
- data/rdoc.gemspec +60 -0
- metadata +32 -155
- data/Manifest.txt +0 -309
- data/lib/rdoc/markdown/literals_1_8.kpeg +0 -18
- data/lib/rdoc/markdown/literals_1_8.rb +0 -416
- data/test/MarkdownTest_1.0.3/Amps and angle encoding.text +0 -21
- data/test/MarkdownTest_1.0.3/Auto links.text +0 -13
- data/test/MarkdownTest_1.0.3/Backslash escapes.text +0 -120
- data/test/MarkdownTest_1.0.3/Blockquotes with code blocks.text +0 -11
- data/test/MarkdownTest_1.0.3/Code Blocks.text +0 -14
- data/test/MarkdownTest_1.0.3/Code Spans.text +0 -6
- data/test/MarkdownTest_1.0.3/Hard-wrapped paragraphs with list-like lines.text +0 -8
- data/test/MarkdownTest_1.0.3/Horizontal rules.text +0 -67
- data/test/MarkdownTest_1.0.3/Inline HTML (Advanced).text +0 -15
- data/test/MarkdownTest_1.0.3/Inline HTML (Simple).text +0 -69
- data/test/MarkdownTest_1.0.3/Inline HTML comments.text +0 -13
- data/test/MarkdownTest_1.0.3/Links, inline style.text +0 -12
- data/test/MarkdownTest_1.0.3/Links, reference style.text +0 -71
- data/test/MarkdownTest_1.0.3/Links, shortcut references.text +0 -20
- data/test/MarkdownTest_1.0.3/Literal quotes in titles.text +0 -7
- data/test/MarkdownTest_1.0.3/Markdown Documentation - Basics.text +0 -306
- data/test/MarkdownTest_1.0.3/Markdown Documentation - Syntax.text +0 -888
- data/test/MarkdownTest_1.0.3/Nested blockquotes.text +0 -5
- data/test/MarkdownTest_1.0.3/Ordered and unordered lists.text +0 -131
- data/test/MarkdownTest_1.0.3/Strong and em together.text +0 -7
- data/test/MarkdownTest_1.0.3/Tabs.text +0 -21
- data/test/MarkdownTest_1.0.3/Tidyness.text +0 -5
- data/test/README +0 -1
- data/test/binary.dat +0 -0
- data/test/hidden.zip.txt +0 -1
- data/test/test.ja.largedoc +0 -3
- data/test/test.ja.rdoc +0 -10
- data/test/test.ja.txt +0 -8
- data/test/test.txt +0 -1
- data/test/test_rdoc_alias.rb +0 -13
- data/test/test_rdoc_any_method.rb +0 -460
- data/test/test_rdoc_attr.rb +0 -190
- data/test/test_rdoc_class_module.rb +0 -1492
- data/test/test_rdoc_code_object.rb +0 -450
- data/test/test_rdoc_comment.rb +0 -504
- data/test/test_rdoc_constant.rb +0 -181
- data/test/test_rdoc_context.rb +0 -901
- data/test/test_rdoc_context_section.rb +0 -130
- data/test/test_rdoc_cross_reference.rb +0 -192
- data/test/test_rdoc_encoding.rb +0 -227
- data/test/test_rdoc_extend.rb +0 -94
- data/test/test_rdoc_generator_darkfish.rb +0 -229
- data/test/test_rdoc_generator_json_index.rb +0 -324
- data/test/test_rdoc_generator_markup.rb +0 -59
- data/test/test_rdoc_generator_pot.rb +0 -91
- data/test/test_rdoc_generator_pot_po.rb +0 -51
- data/test/test_rdoc_generator_pot_po_entry.rb +0 -139
- data/test/test_rdoc_generator_ri.rb +0 -78
- data/test/test_rdoc_i18n_locale.rb +0 -73
- data/test/test_rdoc_i18n_text.rb +0 -123
- data/test/test_rdoc_include.rb +0 -108
- data/test/test_rdoc_markdown.rb +0 -980
- data/test/test_rdoc_markdown_test.rb +0 -1884
- data/test/test_rdoc_markup.rb +0 -95
- data/test/test_rdoc_markup_attribute_manager.rb +0 -364
- data/test/test_rdoc_markup_attributes.rb +0 -39
- data/test/test_rdoc_markup_document.rb +0 -207
- data/test/test_rdoc_markup_formatter.rb +0 -175
- data/test/test_rdoc_markup_hard_break.rb +0 -31
- data/test/test_rdoc_markup_heading.rb +0 -29
- data/test/test_rdoc_markup_include.rb +0 -19
- data/test/test_rdoc_markup_indented_paragraph.rb +0 -53
- data/test/test_rdoc_markup_paragraph.rb +0 -32
- data/test/test_rdoc_markup_parser.rb +0 -1680
- data/test/test_rdoc_markup_pre_process.rb +0 -473
- data/test/test_rdoc_markup_raw.rb +0 -22
- data/test/test_rdoc_markup_to_ansi.rb +0 -369
- data/test/test_rdoc_markup_to_bs.rb +0 -366
- data/test/test_rdoc_markup_to_html.rb +0 -662
- data/test/test_rdoc_markup_to_html_crossref.rb +0 -225
- data/test/test_rdoc_markup_to_html_snippet.rb +0 -711
- data/test/test_rdoc_markup_to_joined_paragraph.rb +0 -32
- data/test/test_rdoc_markup_to_label.rb +0 -112
- data/test/test_rdoc_markup_to_markdown.rb +0 -389
- data/test/test_rdoc_markup_to_rdoc.rb +0 -377
- data/test/test_rdoc_markup_to_table_of_contents.rb +0 -126
- data/test/test_rdoc_markup_to_tt_only.rb +0 -246
- data/test/test_rdoc_markup_verbatim.rb +0 -29
- data/test/test_rdoc_method_attr.rb +0 -193
- data/test/test_rdoc_normal_class.rb +0 -47
- data/test/test_rdoc_normal_module.rb +0 -42
- data/test/test_rdoc_options.rb +0 -766
- data/test/test_rdoc_parser.rb +0 -327
- data/test/test_rdoc_parser_c.rb +0 -1896
- data/test/test_rdoc_parser_changelog.rb +0 -315
- data/test/test_rdoc_parser_markdown.rb +0 -61
- data/test/test_rdoc_parser_rd.rb +0 -55
- data/test/test_rdoc_parser_ruby.rb +0 -3322
- data/test/test_rdoc_parser_simple.rb +0 -115
- data/test/test_rdoc_rd.rb +0 -30
- data/test/test_rdoc_rd_block_parser.rb +0 -535
- data/test/test_rdoc_rd_inline.rb +0 -63
- data/test/test_rdoc_rd_inline_parser.rb +0 -177
- data/test/test_rdoc_rdoc.rb +0 -455
- data/test/test_rdoc_require.rb +0 -25
- data/test/test_rdoc_ri_driver.rb +0 -1436
- data/test/test_rdoc_ri_paths.rb +0 -155
- data/test/test_rdoc_ruby_lex.rb +0 -421
- data/test/test_rdoc_ruby_token.rb +0 -19
- data/test/test_rdoc_rubygems_hook.rb +0 -251
- data/test/test_rdoc_servlet.rb +0 -534
- data/test/test_rdoc_single_class.rb +0 -20
- data/test/test_rdoc_stats.rb +0 -722
- data/test/test_rdoc_store.rb +0 -993
- data/test/test_rdoc_task.rb +0 -173
- data/test/test_rdoc_text.rb +0 -557
- data/test/test_rdoc_token_stream.rb +0 -42
- data/test/test_rdoc_tom_doc.rb +0 -520
- data/test/test_rdoc_top_level.rb +0 -287
- data/test/xref_data.rb +0 -76
- data/test/xref_test_case.rb +0 -67
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'rdoc/test_case'
|
2
|
-
|
3
|
-
class TestRDocMarkupRaw < RDoc::TestCase
|
4
|
-
|
5
|
-
def setup
|
6
|
-
super
|
7
|
-
|
8
|
-
@p = @RM::Raw.new
|
9
|
-
end
|
10
|
-
|
11
|
-
def test_push
|
12
|
-
@p.push 'hi', 'there'
|
13
|
-
|
14
|
-
assert_equal @RM::Raw.new('hi', 'there'), @p
|
15
|
-
end
|
16
|
-
|
17
|
-
def test_pretty_print
|
18
|
-
assert_equal '[raw: ]', mu_pp(@p)
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
|
@@ -1,369 +0,0 @@
|
|
1
|
-
require 'rdoc/test_case'
|
2
|
-
|
3
|
-
class TestRDocMarkupToAnsi < RDoc::Markup::TextFormatterTestCase
|
4
|
-
|
5
|
-
add_visitor_tests
|
6
|
-
add_text_tests
|
7
|
-
|
8
|
-
def setup
|
9
|
-
super
|
10
|
-
|
11
|
-
@to = RDoc::Markup::ToAnsi.new
|
12
|
-
end
|
13
|
-
|
14
|
-
def accept_blank_line
|
15
|
-
assert_equal "\e[0m\n", @to.res.join
|
16
|
-
end
|
17
|
-
|
18
|
-
def accept_block_quote
|
19
|
-
assert_equal "\e[0m> quote\n", @to.res.join
|
20
|
-
end
|
21
|
-
|
22
|
-
def accept_document
|
23
|
-
assert_equal "\e[0mhello\n", @to.res.join
|
24
|
-
end
|
25
|
-
|
26
|
-
def accept_heading
|
27
|
-
assert_equal "\e[0mHello\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 "\e[0mcat:\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 'b', @to.list_index.last
|
78
|
-
end
|
79
|
-
|
80
|
-
def accept_list_item_end_note
|
81
|
-
assert_equal "\e[0mcat:\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 'B', @to.list_index.last
|
93
|
-
end
|
94
|
-
|
95
|
-
def accept_list_item_start_bullet
|
96
|
-
assert_equal %W"\e[0m", @to.res
|
97
|
-
assert_equal '* ', @to.prefix
|
98
|
-
end
|
99
|
-
|
100
|
-
def accept_list_item_start_label
|
101
|
-
assert_equal %W"\e[0m", @to.res
|
102
|
-
assert_equal "cat:\n ", @to.prefix
|
103
|
-
|
104
|
-
assert_equal 2, @to.indent
|
105
|
-
end
|
106
|
-
|
107
|
-
def accept_list_item_start_lalpha
|
108
|
-
assert_equal %W"\e[0m", @to.res
|
109
|
-
assert_equal 'a. ', @to.prefix
|
110
|
-
|
111
|
-
assert_equal 'a', @to.list_index.last
|
112
|
-
assert_equal 3, @to.indent
|
113
|
-
end
|
114
|
-
|
115
|
-
def accept_list_item_start_note
|
116
|
-
assert_equal %W"\e[0m", @to.res
|
117
|
-
assert_equal "cat:\n ", @to.prefix
|
118
|
-
|
119
|
-
assert_equal 2, @to.indent
|
120
|
-
end
|
121
|
-
|
122
|
-
def accept_list_item_start_number
|
123
|
-
assert_equal %W"\e[0m", @to.res
|
124
|
-
assert_equal '1. ', @to.prefix
|
125
|
-
|
126
|
-
assert_equal 1, @to.list_index.last
|
127
|
-
assert_equal 3, @to.indent
|
128
|
-
end
|
129
|
-
|
130
|
-
def accept_list_item_start_ualpha
|
131
|
-
assert_equal %W"\e[0m", @to.res
|
132
|
-
assert_equal 'A. ', @to.prefix
|
133
|
-
|
134
|
-
assert_equal 'A', @to.list_index.last
|
135
|
-
assert_equal 3, @to.indent
|
136
|
-
end
|
137
|
-
|
138
|
-
def accept_list_start_bullet
|
139
|
-
assert_equal "\e[0m", @to.res.join
|
140
|
-
assert_equal [nil], @to.list_index
|
141
|
-
assert_equal [:BULLET], @to.list_type
|
142
|
-
assert_equal [1], @to.list_width
|
143
|
-
end
|
144
|
-
|
145
|
-
def accept_list_start_label
|
146
|
-
assert_equal "\e[0m", @to.res.join
|
147
|
-
assert_equal [nil], @to.list_index
|
148
|
-
assert_equal [:LABEL], @to.list_type
|
149
|
-
assert_equal [2], @to.list_width
|
150
|
-
end
|
151
|
-
|
152
|
-
def accept_list_start_lalpha
|
153
|
-
assert_equal "\e[0m", @to.res.join
|
154
|
-
assert_equal ['a'], @to.list_index
|
155
|
-
assert_equal [:LALPHA], @to.list_type
|
156
|
-
assert_equal [1], @to.list_width
|
157
|
-
end
|
158
|
-
|
159
|
-
def accept_list_start_note
|
160
|
-
assert_equal "\e[0m", @to.res.join
|
161
|
-
assert_equal [nil], @to.list_index
|
162
|
-
assert_equal [:NOTE], @to.list_type
|
163
|
-
assert_equal [2], @to.list_width
|
164
|
-
end
|
165
|
-
|
166
|
-
def accept_list_start_number
|
167
|
-
assert_equal "\e[0m", @to.res.join
|
168
|
-
assert_equal [1], @to.list_index
|
169
|
-
assert_equal [:NUMBER], @to.list_type
|
170
|
-
assert_equal [1], @to.list_width
|
171
|
-
end
|
172
|
-
|
173
|
-
def accept_list_start_ualpha
|
174
|
-
assert_equal "\e[0m", @to.res.join
|
175
|
-
assert_equal ['A'], @to.list_index
|
176
|
-
assert_equal [:UALPHA], @to.list_type
|
177
|
-
assert_equal [1], @to.list_width
|
178
|
-
end
|
179
|
-
|
180
|
-
def accept_paragraph
|
181
|
-
assert_equal "\e[0mhi\n", @to.res.join
|
182
|
-
end
|
183
|
-
|
184
|
-
def accept_raw
|
185
|
-
raw = <<-RAW.rstrip
|
186
|
-
\e[0m<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 "\e[0m#{'-' * 78}\n", @to.res.join
|
198
|
-
end
|
199
|
-
|
200
|
-
def accept_verbatim
|
201
|
-
assert_equal "\e[0m hi\n world\n\n", @to.res.join
|
202
|
-
end
|
203
|
-
|
204
|
-
def end_accepting
|
205
|
-
assert_equal "\e[0mhi", @to.end_accepting
|
206
|
-
end
|
207
|
-
|
208
|
-
def start_accepting
|
209
|
-
assert_equal 0, @to.indent
|
210
|
-
assert_equal %W"\e[0m", @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 "\e[0m\e[1;32mHello\e[m\n", @to.end_accepting
|
218
|
-
end
|
219
|
-
|
220
|
-
def accept_heading_2
|
221
|
-
assert_equal "\e[0m\e[4;32mHello\e[m\n", @to.end_accepting
|
222
|
-
end
|
223
|
-
|
224
|
-
def accept_heading_3
|
225
|
-
assert_equal "\e[0m\e[32mHello\e[m\n", @to.end_accepting
|
226
|
-
end
|
227
|
-
|
228
|
-
def accept_heading_4
|
229
|
-
assert_equal "\e[0mHello\n", @to.end_accepting
|
230
|
-
end
|
231
|
-
|
232
|
-
def accept_heading_indent
|
233
|
-
assert_equal "\e[0m \e[1;32mHello\e[m\n", @to.end_accepting
|
234
|
-
end
|
235
|
-
|
236
|
-
def accept_heading_b
|
237
|
-
assert_equal "\e[0m\e[1;32m\e[1mHello\e[m\e[m\n", @to.end_accepting
|
238
|
-
end
|
239
|
-
|
240
|
-
def accept_heading_suppressed_crossref
|
241
|
-
assert_equal "\e[0m\e[1;32mHello\e[m\n", @to.end_accepting
|
242
|
-
end
|
243
|
-
|
244
|
-
def accept_list_item_start_note_2
|
245
|
-
assert_equal "\e[0m\e[7mteletype\e[m:\n teletype description\n\n",
|
246
|
-
@to.res.join
|
247
|
-
end
|
248
|
-
|
249
|
-
def accept_list_item_start_note_multi_description
|
250
|
-
assert_equal "\e[0mlabel:\n description one\n\n description two\n\n",
|
251
|
-
@to.res.join
|
252
|
-
end
|
253
|
-
|
254
|
-
def accept_list_item_start_note_multi_label
|
255
|
-
assert_equal "\e[0mone\ntwo:\n two headers\n\n",
|
256
|
-
@to.res.join
|
257
|
-
end
|
258
|
-
|
259
|
-
def accept_paragraph_b
|
260
|
-
assert_equal "\e[0mreg \e[1mbold words\e[m reg\n", @to.end_accepting
|
261
|
-
end
|
262
|
-
|
263
|
-
def accept_paragraph_br
|
264
|
-
assert_equal "\e[0mone\ntwo\n", @to.end_accepting
|
265
|
-
end
|
266
|
-
|
267
|
-
def accept_paragraph_break
|
268
|
-
assert_equal "\e[0mhello\nworld\n", @to.end_accepting
|
269
|
-
end
|
270
|
-
|
271
|
-
def accept_paragraph_i
|
272
|
-
assert_equal "\e[0mreg \e[4mitalic words\e[m reg\n", @to.end_accepting
|
273
|
-
end
|
274
|
-
|
275
|
-
def accept_paragraph_indent
|
276
|
-
expected = <<-EXPECTED
|
277
|
-
\e[0m words words words words words words words words words words words words
|
278
|
-
words words words words words words words words words words words words
|
279
|
-
words words words words words words
|
280
|
-
EXPECTED
|
281
|
-
|
282
|
-
assert_equal expected, @to.end_accepting
|
283
|
-
end
|
284
|
-
|
285
|
-
def accept_paragraph_plus
|
286
|
-
assert_equal "\e[0mreg \e[7mteletype\e[m reg\n", @to.end_accepting
|
287
|
-
end
|
288
|
-
|
289
|
-
def accept_paragraph_star
|
290
|
-
assert_equal "\e[0mreg \e[1mbold\e[m reg\n", @to.end_accepting
|
291
|
-
end
|
292
|
-
|
293
|
-
def accept_paragraph_underscore
|
294
|
-
assert_equal "\e[0mreg \e[4mitalic\e[m reg\n", @to.end_accepting
|
295
|
-
end
|
296
|
-
|
297
|
-
def accept_paragraph_wrap
|
298
|
-
expected = <<-EXPECTED
|
299
|
-
\e[0mwords words words words words words words words words words words words words
|
300
|
-
words words words words words words words words words words words words words
|
301
|
-
words words words words
|
302
|
-
EXPECTED
|
303
|
-
|
304
|
-
assert_equal expected, @to.end_accepting
|
305
|
-
end
|
306
|
-
|
307
|
-
def accept_rule_indent
|
308
|
-
assert_equal "\e[0m #{'-' * 75}\n", @to.end_accepting
|
309
|
-
end
|
310
|
-
|
311
|
-
def accept_verbatim_indent
|
312
|
-
assert_equal "\e[0m hi\n world\n\n", @to.end_accepting
|
313
|
-
end
|
314
|
-
|
315
|
-
def accept_verbatim_big_indent
|
316
|
-
assert_equal "\e[0m hi\n world\n\n", @to.end_accepting
|
317
|
-
end
|
318
|
-
|
319
|
-
def list_nested
|
320
|
-
expected = <<-EXPECTED
|
321
|
-
\e[0m* l1
|
322
|
-
* l1.1
|
323
|
-
* l2
|
324
|
-
EXPECTED
|
325
|
-
|
326
|
-
assert_equal expected, @to.end_accepting
|
327
|
-
end
|
328
|
-
|
329
|
-
def list_verbatim
|
330
|
-
expected = <<-EXPECTED # HACK overblown
|
331
|
-
\e[0m* 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
|
-
EXPECTED
|
346
|
-
|
347
|
-
assert_equal expected, @to.end_accepting
|
348
|
-
end
|
349
|
-
|
350
|
-
# functional test
|
351
|
-
def test_convert_list_note
|
352
|
-
note_list = <<-NOTE_LIST
|
353
|
-
foo ::
|
354
|
-
bar ::
|
355
|
-
hi
|
356
|
-
NOTE_LIST
|
357
|
-
|
358
|
-
expected = <<-EXPECTED
|
359
|
-
\e[0mfoo
|
360
|
-
bar:
|
361
|
-
hi
|
362
|
-
|
363
|
-
EXPECTED
|
364
|
-
|
365
|
-
assert_equal expected, @to.convert(note_list)
|
366
|
-
end
|
367
|
-
|
368
|
-
end
|
369
|
-
|
@@ -1,366 +0,0 @@
|
|
1
|
-
require 'rdoc/test_case'
|
2
|
-
|
3
|
-
class TestRDocMarkupToBs < RDoc::Markup::TextFormatterTestCase
|
4
|
-
|
5
|
-
add_visitor_tests
|
6
|
-
add_text_tests
|
7
|
-
|
8
|
-
def setup
|
9
|
-
super
|
10
|
-
|
11
|
-
@to = RDoc::Markup::ToBs.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
|
-
skip "No String#chars, upgrade your ruby" unless ''.respond_to? :chars
|
28
|
-
assert_equal "===== H\bHe\bel\bll\blo\bo\n", @to.res.join
|
29
|
-
end
|
30
|
-
|
31
|
-
def accept_list_end_bullet
|
32
|
-
assert_empty @to.list_index
|
33
|
-
assert_empty @to.list_type
|
34
|
-
assert_empty @to.list_width
|
35
|
-
end
|
36
|
-
|
37
|
-
def accept_list_end_label
|
38
|
-
assert_empty @to.list_index
|
39
|
-
assert_empty @to.list_type
|
40
|
-
assert_empty @to.list_width
|
41
|
-
end
|
42
|
-
|
43
|
-
def accept_list_end_lalpha
|
44
|
-
assert_empty @to.list_index
|
45
|
-
assert_empty @to.list_type
|
46
|
-
assert_empty @to.list_width
|
47
|
-
end
|
48
|
-
|
49
|
-
def accept_list_end_note
|
50
|
-
assert_empty @to.list_index
|
51
|
-
assert_empty @to.list_type
|
52
|
-
assert_empty @to.list_width
|
53
|
-
end
|
54
|
-
|
55
|
-
def accept_list_end_number
|
56
|
-
assert_empty @to.list_index
|
57
|
-
assert_empty @to.list_type
|
58
|
-
assert_empty @to.list_width
|
59
|
-
end
|
60
|
-
|
61
|
-
def accept_list_end_ualpha
|
62
|
-
assert_empty @to.list_index
|
63
|
-
assert_empty @to.list_type
|
64
|
-
assert_empty @to.list_width
|
65
|
-
end
|
66
|
-
|
67
|
-
def accept_list_item_end_bullet
|
68
|
-
assert_equal 0, @to.indent, 'indent'
|
69
|
-
end
|
70
|
-
|
71
|
-
def accept_list_item_end_label
|
72
|
-
assert_equal "cat:\n", @to.res.join
|
73
|
-
assert_equal 0, @to.indent, 'indent'
|
74
|
-
end
|
75
|
-
|
76
|
-
def accept_list_item_end_lalpha
|
77
|
-
assert_equal 0, @to.indent, 'indent'
|
78
|
-
assert_equal 'b', @to.list_index.last
|
79
|
-
end
|
80
|
-
|
81
|
-
def accept_list_item_end_note
|
82
|
-
assert_equal "cat:\n", @to.res.join
|
83
|
-
assert_equal 0, @to.indent, 'indent'
|
84
|
-
end
|
85
|
-
|
86
|
-
def accept_list_item_end_number
|
87
|
-
assert_equal 0, @to.indent, 'indent'
|
88
|
-
assert_equal 2, @to.list_index.last
|
89
|
-
end
|
90
|
-
|
91
|
-
def accept_list_item_end_ualpha
|
92
|
-
assert_equal 0, @to.indent, 'indent'
|
93
|
-
assert_equal 'B', @to.list_index.last
|
94
|
-
end
|
95
|
-
|
96
|
-
def accept_list_item_start_bullet
|
97
|
-
assert_equal [''], @to.res
|
98
|
-
assert_equal '* ', @to.prefix
|
99
|
-
end
|
100
|
-
|
101
|
-
def accept_list_item_start_label
|
102
|
-
assert_equal [''], @to.res
|
103
|
-
assert_equal "cat:\n ", @to.prefix
|
104
|
-
|
105
|
-
assert_equal 2, @to.indent
|
106
|
-
end
|
107
|
-
|
108
|
-
def accept_list_item_start_lalpha
|
109
|
-
assert_equal [''], @to.res
|
110
|
-
assert_equal 'a. ', @to.prefix
|
111
|
-
|
112
|
-
assert_equal 'a', @to.list_index.last
|
113
|
-
assert_equal 3, @to.indent
|
114
|
-
end
|
115
|
-
|
116
|
-
def accept_list_item_start_note
|
117
|
-
assert_equal [''], @to.res
|
118
|
-
assert_equal "cat:\n ", @to.prefix
|
119
|
-
|
120
|
-
assert_equal 2, @to.indent
|
121
|
-
end
|
122
|
-
|
123
|
-
def accept_list_item_start_number
|
124
|
-
assert_equal [''], @to.res
|
125
|
-
assert_equal '1. ', @to.prefix
|
126
|
-
|
127
|
-
assert_equal 1, @to.list_index.last
|
128
|
-
assert_equal 3, @to.indent
|
129
|
-
end
|
130
|
-
|
131
|
-
def accept_list_item_start_ualpha
|
132
|
-
assert_equal [''], @to.res
|
133
|
-
assert_equal 'A. ', @to.prefix
|
134
|
-
|
135
|
-
assert_equal 'A', @to.list_index.last
|
136
|
-
assert_equal 3, @to.indent
|
137
|
-
end
|
138
|
-
|
139
|
-
def accept_list_start_bullet
|
140
|
-
assert_equal "", @to.res.join
|
141
|
-
assert_equal [nil], @to.list_index
|
142
|
-
assert_equal [:BULLET], @to.list_type
|
143
|
-
assert_equal [1], @to.list_width
|
144
|
-
end
|
145
|
-
|
146
|
-
def accept_list_start_label
|
147
|
-
assert_equal "", @to.res.join
|
148
|
-
assert_equal [nil], @to.list_index
|
149
|
-
assert_equal [:LABEL], @to.list_type
|
150
|
-
assert_equal [2], @to.list_width
|
151
|
-
end
|
152
|
-
|
153
|
-
def accept_list_start_lalpha
|
154
|
-
assert_equal "", @to.res.join
|
155
|
-
assert_equal ['a'], @to.list_index
|
156
|
-
assert_equal [:LALPHA], @to.list_type
|
157
|
-
assert_equal [1], @to.list_width
|
158
|
-
end
|
159
|
-
|
160
|
-
def accept_list_start_note
|
161
|
-
assert_equal "", @to.res.join
|
162
|
-
assert_equal [nil], @to.list_index
|
163
|
-
assert_equal [:NOTE], @to.list_type
|
164
|
-
assert_equal [2], @to.list_width
|
165
|
-
end
|
166
|
-
|
167
|
-
def accept_list_start_number
|
168
|
-
assert_equal "", @to.res.join
|
169
|
-
assert_equal [1], @to.list_index
|
170
|
-
assert_equal [:NUMBER], @to.list_type
|
171
|
-
assert_equal [1], @to.list_width
|
172
|
-
end
|
173
|
-
|
174
|
-
def accept_list_start_ualpha
|
175
|
-
assert_equal "", @to.res.join
|
176
|
-
assert_equal ['A'], @to.list_index
|
177
|
-
assert_equal [:UALPHA], @to.list_type
|
178
|
-
assert_equal [1], @to.list_width
|
179
|
-
end
|
180
|
-
|
181
|
-
def accept_paragraph
|
182
|
-
assert_equal "hi\n", @to.res.join
|
183
|
-
end
|
184
|
-
|
185
|
-
def accept_raw
|
186
|
-
raw = <<-RAW.rstrip
|
187
|
-
<table>
|
188
|
-
<tr><th>Name<th>Count
|
189
|
-
<tr><td>a<td>1
|
190
|
-
<tr><td>b<td>2
|
191
|
-
</table>
|
192
|
-
RAW
|
193
|
-
|
194
|
-
assert_equal raw, @to.res.join
|
195
|
-
end
|
196
|
-
|
197
|
-
def accept_rule
|
198
|
-
assert_equal "#{'-' * 78}\n", @to.res.join
|
199
|
-
end
|
200
|
-
|
201
|
-
def accept_verbatim
|
202
|
-
assert_equal " hi\n world\n\n", @to.res.join
|
203
|
-
end
|
204
|
-
|
205
|
-
def end_accepting
|
206
|
-
assert_equal "hi", @to.end_accepting
|
207
|
-
end
|
208
|
-
|
209
|
-
def start_accepting
|
210
|
-
assert_equal 0, @to.indent
|
211
|
-
assert_equal [''], @to.res
|
212
|
-
assert_empty @to.list_index
|
213
|
-
assert_empty @to.list_type
|
214
|
-
assert_empty @to.list_width
|
215
|
-
end
|
216
|
-
|
217
|
-
def accept_heading_1
|
218
|
-
skip "No String#chars, upgrade your ruby" unless ''.respond_to? :chars
|
219
|
-
assert_equal "= H\bHe\bel\bll\blo\bo\n", @to.end_accepting
|
220
|
-
end
|
221
|
-
|
222
|
-
def accept_heading_2
|
223
|
-
skip "No String#chars, upgrade your ruby" unless ''.respond_to? :chars
|
224
|
-
assert_equal "== H\bHe\bel\bll\blo\bo\n", @to.end_accepting
|
225
|
-
end
|
226
|
-
|
227
|
-
def accept_heading_3
|
228
|
-
skip "No String#chars, upgrade your ruby" unless ''.respond_to? :chars
|
229
|
-
assert_equal "=== H\bHe\bel\bll\blo\bo\n", @to.end_accepting
|
230
|
-
end
|
231
|
-
|
232
|
-
def accept_heading_4
|
233
|
-
skip "No String#chars, upgrade your ruby" unless ''.respond_to? :chars
|
234
|
-
assert_equal "==== H\bHe\bel\bll\blo\bo\n", @to.end_accepting
|
235
|
-
end
|
236
|
-
|
237
|
-
def accept_heading_indent
|
238
|
-
skip "No String#chars, upgrade your ruby" unless ''.respond_to? :chars
|
239
|
-
assert_equal " = H\bHe\bel\bll\blo\bo\n", @to.end_accepting
|
240
|
-
end
|
241
|
-
|
242
|
-
def accept_heading_b
|
243
|
-
skip "No String#chars, upgrade your ruby" unless ''.respond_to? :chars
|
244
|
-
assert_equal "= H\bHe\bel\bll\blo\bo\n", @to.end_accepting
|
245
|
-
end
|
246
|
-
|
247
|
-
def accept_heading_suppressed_crossref
|
248
|
-
skip "No String#chars, upgrade your ruby" unless ''.respond_to? :chars
|
249
|
-
assert_equal "= H\bHe\bel\bll\blo\bo\n", @to.end_accepting
|
250
|
-
end
|
251
|
-
|
252
|
-
def accept_list_item_start_note_2
|
253
|
-
assert_equal "teletype:\n teletype description\n\n", @to.res.join
|
254
|
-
end
|
255
|
-
|
256
|
-
def accept_list_item_start_note_multi_description
|
257
|
-
assert_equal "label:\n description one\n\n description two\n\n",
|
258
|
-
@to.res.join
|
259
|
-
end
|
260
|
-
|
261
|
-
def accept_list_item_start_note_multi_label
|
262
|
-
assert_equal "one\ntwo:\n two headers\n\n", @to.res.join
|
263
|
-
end
|
264
|
-
|
265
|
-
def accept_paragraph_b
|
266
|
-
skip "No String#chars, upgrade your ruby" unless ''.respond_to? :chars
|
267
|
-
assert_equal "reg b\bbo\bol\bld\bd \b w\bwo\bor\brd\bds\bs reg\n",
|
268
|
-
@to.end_accepting
|
269
|
-
end
|
270
|
-
|
271
|
-
def accept_paragraph_br
|
272
|
-
skip "No String#chars, upgrade your ruby" unless ''.respond_to? :chars
|
273
|
-
assert_equal "one\ntwo\n", @to.end_accepting
|
274
|
-
end
|
275
|
-
|
276
|
-
def accept_paragraph_break
|
277
|
-
skip "No String#chars, upgrade your ruby" unless ''.respond_to? :chars
|
278
|
-
assert_equal "hello\nworld\n",
|
279
|
-
@to.end_accepting
|
280
|
-
end
|
281
|
-
|
282
|
-
def accept_paragraph_i
|
283
|
-
skip "No String#chars, upgrade your ruby" unless ''.respond_to? :chars
|
284
|
-
assert_equal "reg _\bi_\bt_\ba_\bl_\bi_\bc_\b _\bw_\bo_\br_\bd_\bs reg\n",
|
285
|
-
@to.end_accepting
|
286
|
-
end
|
287
|
-
|
288
|
-
def accept_paragraph_indent
|
289
|
-
expected = <<-EXPECTED
|
290
|
-
words words words words words words words words words words words words
|
291
|
-
words words words words words words words words words words words words
|
292
|
-
words words words words words words
|
293
|
-
EXPECTED
|
294
|
-
|
295
|
-
assert_equal expected, @to.end_accepting
|
296
|
-
end
|
297
|
-
|
298
|
-
def accept_paragraph_plus
|
299
|
-
assert_equal "reg teletype reg\n", @to.end_accepting
|
300
|
-
end
|
301
|
-
|
302
|
-
def accept_paragraph_star
|
303
|
-
skip "No String#chars, upgrade your ruby" unless ''.respond_to? :chars
|
304
|
-
assert_equal "reg b\bbo\bol\bld\bd reg\n", @to.end_accepting
|
305
|
-
end
|
306
|
-
|
307
|
-
def accept_paragraph_underscore
|
308
|
-
skip "No String#chars, upgrade your ruby" unless ''.respond_to? :chars
|
309
|
-
assert_equal "reg _\bi_\bt_\ba_\bl_\bi_\bc reg\n", @to.end_accepting
|
310
|
-
end
|
311
|
-
|
312
|
-
def accept_paragraph_wrap
|
313
|
-
expected = <<-EXPECTED
|
314
|
-
words words words words words words words words words words words words words
|
315
|
-
words words words words words words words words words words words words words
|
316
|
-
words words words words
|
317
|
-
EXPECTED
|
318
|
-
|
319
|
-
assert_equal expected, @to.end_accepting
|
320
|
-
end
|
321
|
-
|
322
|
-
def accept_rule_indent
|
323
|
-
assert_equal " #{'-' * 75}\n", @to.end_accepting
|
324
|
-
end
|
325
|
-
|
326
|
-
def accept_verbatim_indent
|
327
|
-
assert_equal " hi\n world\n\n", @to.end_accepting
|
328
|
-
end
|
329
|
-
|
330
|
-
def accept_verbatim_big_indent
|
331
|
-
assert_equal " hi\n world\n\n", @to.end_accepting
|
332
|
-
end
|
333
|
-
|
334
|
-
def list_nested
|
335
|
-
expected = <<-EXPECTED
|
336
|
-
* l1
|
337
|
-
* l1.1
|
338
|
-
* l2
|
339
|
-
EXPECTED
|
340
|
-
|
341
|
-
assert_equal expected, @to.end_accepting
|
342
|
-
end
|
343
|
-
|
344
|
-
def list_verbatim
|
345
|
-
expected = <<-EXPECTED # HACK overblown
|
346
|
-
* list stuff
|
347
|
-
|
348
|
-
* list
|
349
|
-
with
|
350
|
-
|
351
|
-
second
|
352
|
-
|
353
|
-
1. indented
|
354
|
-
2. numbered
|
355
|
-
|
356
|
-
third
|
357
|
-
|
358
|
-
* second
|
359
|
-
|
360
|
-
EXPECTED
|
361
|
-
|
362
|
-
assert_equal expected, @to.end_accepting
|
363
|
-
end
|
364
|
-
|
365
|
-
end
|
366
|
-
|