rdoc 2.4.3 → 2.5
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.
- data.tar.gz.sig +0 -0
- data/.autotest +3 -1
- data/History.txt +68 -0
- data/LICENSE.txt +57 -0
- data/Manifest.txt +37 -19
- data/README.txt +2 -12
- data/Rakefile +12 -12
- data/bin/rdoc +4 -4
- data/lib/rdoc.rb +32 -9
- data/lib/rdoc/alias.rb +2 -2
- data/lib/rdoc/any_method.rb +108 -16
- data/lib/rdoc/attr.rb +87 -1
- data/lib/rdoc/class_module.rb +131 -5
- data/lib/rdoc/code_object.rb +28 -5
- data/lib/rdoc/constant.rb +22 -0
- data/lib/rdoc/context.rb +80 -37
- data/lib/rdoc/gauntlet.rb +48 -0
- data/lib/rdoc/generator/darkfish.rb +25 -23
- data/lib/rdoc/generator/markup.rb +6 -29
- data/lib/rdoc/generator/ri.rb +39 -189
- data/lib/rdoc/generator/template/darkfish/classpage.rhtml +17 -1
- data/lib/rdoc/generator/template/darkfish/filepage.rhtml +10 -0
- data/lib/rdoc/generator/template/darkfish/images/brick.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/brick_link.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/bullet_black.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/date.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/find.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/package.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/page_green.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/page_white_text.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/page_white_width.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/plugin.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/ruby.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/tag_green.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/wrench.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/wrench_orange.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/zoom.png +0 -0
- data/lib/rdoc/generator/template/darkfish/index.rhtml +2 -2
- data/lib/rdoc/generator/template/darkfish/rdoc.css +38 -33
- data/lib/rdoc/include.rb +22 -0
- data/lib/rdoc/markup.rb +10 -262
- data/lib/rdoc/markup/attribute_manager.rb +57 -50
- data/lib/rdoc/markup/blank_line.rb +19 -0
- data/lib/rdoc/markup/document.rb +72 -0
- data/lib/rdoc/markup/formatter.rb +118 -0
- data/lib/rdoc/markup/formatter_test_case.rb +341 -0
- data/lib/rdoc/markup/heading.rb +17 -0
- data/lib/rdoc/markup/inline.rb +6 -5
- data/lib/rdoc/markup/list.rb +78 -0
- data/lib/rdoc/markup/list_item.rb +83 -0
- data/lib/rdoc/markup/paragraph.rb +66 -0
- data/lib/rdoc/markup/parser.rb +528 -0
- data/lib/rdoc/markup/rule.rb +17 -0
- data/lib/rdoc/markup/to_ansi.rb +72 -0
- data/lib/rdoc/markup/to_bs.rb +74 -0
- data/lib/rdoc/markup/to_html.rb +106 -172
- data/lib/rdoc/markup/to_html_crossref.rb +10 -4
- data/lib/rdoc/markup/to_rdoc.rb +243 -0
- data/lib/rdoc/markup/to_test.rb +27 -16
- data/lib/rdoc/markup/verbatim.rb +42 -0
- data/lib/rdoc/normal_class.rb +38 -1
- data/lib/rdoc/normal_module.rb +38 -8
- data/lib/rdoc/options.rb +39 -151
- data/lib/rdoc/parser.rb +36 -18
- data/lib/rdoc/parser/c.rb +102 -109
- data/lib/rdoc/parser/ruby.rb +359 -1662
- data/lib/rdoc/parser/ruby_tools.rb +157 -0
- data/lib/rdoc/parser/simple.rb +0 -2
- data/lib/rdoc/rdoc.rb +142 -82
- data/lib/rdoc/ri.rb +10 -0
- data/lib/rdoc/ri/driver.rb +674 -444
- data/lib/rdoc/ri/formatter.rb +2 -651
- data/lib/rdoc/ri/paths.rb +70 -45
- data/lib/rdoc/ri/store.rb +248 -0
- data/lib/rdoc/ruby_lex.rb +1284 -0
- data/lib/rdoc/ruby_token.rb +416 -0
- data/lib/rdoc/single_class.rb +5 -0
- data/lib/rdoc/stats.rb +152 -83
- data/lib/rdoc/task.rb +27 -49
- data/lib/rdoc/text.rb +130 -0
- data/lib/rdoc/tokenstream.rb +28 -9
- data/lib/rdoc/top_level.rb +49 -43
- data/test/hidden.zip.txt +1 -0
- data/test/test_attribute_manager.rb +9 -16
- data/test/test_rdoc_any_method.rb +23 -0
- data/test/test_rdoc_attr.rb +40 -0
- data/test/test_rdoc_class_module.rb +100 -0
- data/test/test_rdoc_code_object.rb +18 -2
- data/test/test_rdoc_context.rb +41 -0
- data/test/test_rdoc_generator_ri.rb +56 -0
- data/test/test_rdoc_markup.rb +21 -610
- data/test/test_rdoc_markup_attribute_manager.rb +14 -17
- data/test/test_rdoc_markup_document.rb +51 -0
- data/test/test_rdoc_markup_paragraph.rb +27 -0
- data/test/test_rdoc_markup_parser.rb +1327 -0
- data/test/test_rdoc_markup_to_ansi.rb +426 -0
- data/test/test_rdoc_markup_to_bs.rb +443 -0
- data/test/test_rdoc_markup_to_html.rb +183 -18
- data/test/test_rdoc_markup_to_html_crossref.rb +1 -3
- data/test/test_rdoc_markup_to_rdoc.rb +426 -0
- data/test/test_rdoc_normal_class.rb +17 -0
- data/test/test_rdoc_normal_module.rb +6 -6
- data/test/test_rdoc_options.rb +41 -0
- data/test/test_rdoc_parser.rb +66 -13
- data/test/test_rdoc_parser_c.rb +93 -38
- data/test/test_rdoc_parser_perl.rb +2 -3
- data/test/test_rdoc_parser_ruby.rb +291 -28
- data/test/test_rdoc_parser_simple.rb +48 -0
- data/test/test_rdoc_rdoc.rb +66 -0
- data/test/test_rdoc_ri_driver.rb +752 -38
- data/test/test_rdoc_ri_paths.rb +39 -0
- data/test/test_rdoc_ri_store.rb +309 -0
- data/test/test_rdoc_text.rb +157 -0
- data/test/test_rdoc_top_level.rb +35 -9
- data/test/xref_data.rb +9 -1
- data/test/xref_test_case.rb +8 -3
- metadata +110 -38
- metadata.gz.sig +0 -0
- data/lib/rdoc/cache.rb +0 -41
- data/lib/rdoc/diagram.rb +0 -340
- data/lib/rdoc/dot.rb +0 -249
- data/lib/rdoc/markup/fragments.rb +0 -377
- data/lib/rdoc/markup/lines.rb +0 -156
- data/lib/rdoc/markup/to_flow.rb +0 -211
- data/lib/rdoc/markup/to_latex.rb +0 -328
- data/lib/rdoc/markup/to_texinfo.rb +0 -73
- data/lib/rdoc/ri/cache.rb +0 -187
- data/lib/rdoc/ri/descriptions.rb +0 -156
- data/lib/rdoc/ri/display.rb +0 -340
- data/lib/rdoc/ri/reader.rb +0 -106
- data/lib/rdoc/ri/util.rb +0 -79
- data/lib/rdoc/ri/writer.rb +0 -68
- data/test/test_rdoc_ri_attribute_formatter.rb +0 -44
- data/test/test_rdoc_ri_default_display.rb +0 -302
- data/test/test_rdoc_ri_formatter.rb +0 -320
- data/test/test_rdoc_ri_html_formatter.rb +0 -141
- data/test/test_rdoc_ri_overstrike_formatter.rb +0 -71
@@ -1,320 +0,0 @@
|
|
1
|
-
require 'stringio'
|
2
|
-
require 'rubygems'
|
3
|
-
require 'minitest/unit'
|
4
|
-
require 'rdoc/ri/formatter'
|
5
|
-
require 'rdoc/markup/to_flow'
|
6
|
-
|
7
|
-
class TestRDocRIFormatter < MiniTest::Unit::TestCase
|
8
|
-
|
9
|
-
def setup
|
10
|
-
@output = StringIO.new
|
11
|
-
@width = 78
|
12
|
-
@indent = ' '
|
13
|
-
|
14
|
-
@f = RDoc::RI::Formatter.new @output, @width, @indent
|
15
|
-
@markup = RDoc::Markup.new
|
16
|
-
@flow = RDoc::Markup::ToFlow.new
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_blankline
|
20
|
-
@f.blankline
|
21
|
-
|
22
|
-
assert_equal "\n", @output.string
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_bold_print
|
26
|
-
@f.bold_print 'a b c'
|
27
|
-
|
28
|
-
assert_equal 'a b c', @output.string
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_break_to_newline
|
32
|
-
@f.break_to_newline
|
33
|
-
|
34
|
-
assert_equal '', @output.string
|
35
|
-
end
|
36
|
-
|
37
|
-
def test_conv_html
|
38
|
-
assert_equal '> < " &', @f.conv_html('> < " &')
|
39
|
-
end
|
40
|
-
|
41
|
-
def test_conv_markup
|
42
|
-
text = '<tt>a</tt> <code>b</code> <b>c</b> <em>d</em>'
|
43
|
-
|
44
|
-
expected = '+a+ +b+ *c* _d_'
|
45
|
-
|
46
|
-
assert_equal expected, @f.conv_markup(text)
|
47
|
-
end
|
48
|
-
|
49
|
-
def test_display_flow
|
50
|
-
flow = [
|
51
|
-
RDoc::Markup::Flow::H.new(1, 'heading'),
|
52
|
-
RDoc::Markup::Flow::P.new('paragraph'),
|
53
|
-
]
|
54
|
-
|
55
|
-
@f.display_flow flow
|
56
|
-
|
57
|
-
assert_equal "\nHEADING\n=======\n\n paragraph\n\n", @output.string
|
58
|
-
end
|
59
|
-
|
60
|
-
def test_display_flow_item_h
|
61
|
-
item = RDoc::Markup::Flow::H.new 1, 'heading'
|
62
|
-
|
63
|
-
@f.display_flow_item item
|
64
|
-
|
65
|
-
assert_equal "\nHEADING\n=======\n\n", @output.string
|
66
|
-
end
|
67
|
-
|
68
|
-
def test_display_flow_item_li
|
69
|
-
item = RDoc::Markup::Flow::LI.new nil, 'paragraph'
|
70
|
-
|
71
|
-
@f.display_flow_item item
|
72
|
-
|
73
|
-
assert_equal " paragraph\n\n", @output.string
|
74
|
-
end
|
75
|
-
|
76
|
-
def test_display_flow_item_list
|
77
|
-
item = RDoc::Markup::Flow::LIST.new :NUMBER
|
78
|
-
|
79
|
-
@f.display_flow_item item
|
80
|
-
|
81
|
-
assert_equal "", @output.string
|
82
|
-
end
|
83
|
-
|
84
|
-
def test_display_flow_item_p
|
85
|
-
item = RDoc::Markup::Flow::P.new 'paragraph'
|
86
|
-
|
87
|
-
@f.display_flow_item item
|
88
|
-
|
89
|
-
assert_equal " paragraph\n\n", @output.string
|
90
|
-
end
|
91
|
-
|
92
|
-
def test_display_flow_item_rule
|
93
|
-
item = RDoc::Markup::Flow::RULE.new 1
|
94
|
-
|
95
|
-
@f.display_flow_item item
|
96
|
-
|
97
|
-
assert_equal "#{'-' * 78}\n", @output.string
|
98
|
-
end
|
99
|
-
|
100
|
-
def test_display_flow_item_unknown
|
101
|
-
e = assert_raises RDoc::Error do
|
102
|
-
@f.display_flow_item Object.new
|
103
|
-
end
|
104
|
-
|
105
|
-
assert_equal "Unknown flow element: Object", e.message
|
106
|
-
end
|
107
|
-
|
108
|
-
def test_display_flow_item_verb
|
109
|
-
item = RDoc::Markup::Flow::VERB.new 'a b c'
|
110
|
-
|
111
|
-
@f.display_flow_item item
|
112
|
-
|
113
|
-
assert_equal " a b c\n\n", @output.string
|
114
|
-
end
|
115
|
-
|
116
|
-
def test_display_heading_1
|
117
|
-
@f.display_heading 'heading', 1, ' '
|
118
|
-
|
119
|
-
assert_equal "\nHEADING\n=======\n\n", @output.string
|
120
|
-
end
|
121
|
-
|
122
|
-
def test_display_heading_2
|
123
|
-
@f.display_heading 'heading', 2, ' '
|
124
|
-
|
125
|
-
assert_equal "\nheading\n-------\n\n", @output.string
|
126
|
-
end
|
127
|
-
|
128
|
-
def test_display_heading_3
|
129
|
-
@f.display_heading 'heading', 3, ' '
|
130
|
-
|
131
|
-
assert_equal " heading\n\n", @output.string
|
132
|
-
end
|
133
|
-
|
134
|
-
def test_display_list
|
135
|
-
list = RDoc::Markup::Flow::LIST.new :NUMBER
|
136
|
-
list << RDoc::Markup::Flow::LI.new(nil, 'a b c')
|
137
|
-
list << RDoc::Markup::Flow::LI.new(nil, 'd e f')
|
138
|
-
|
139
|
-
@f.display_list list
|
140
|
-
|
141
|
-
assert_equal " 1. a b c\n\n 2. d e f\n\n", @output.string
|
142
|
-
end
|
143
|
-
|
144
|
-
def test_display_list_bullet
|
145
|
-
list = RDoc::Markup::Flow::LIST.new :BULLET
|
146
|
-
list << RDoc::Markup::Flow::LI.new(nil, 'a b c')
|
147
|
-
|
148
|
-
@f.display_list list
|
149
|
-
|
150
|
-
assert_equal " * a b c\n\n", @output.string
|
151
|
-
end
|
152
|
-
|
153
|
-
def test_display_list_labeled
|
154
|
-
list = RDoc::Markup::Flow::LIST.new :LABELED
|
155
|
-
list << RDoc::Markup::Flow::LI.new('label', 'a b c')
|
156
|
-
|
157
|
-
@f.display_list list
|
158
|
-
|
159
|
-
assert_equal " label a b c\n\n", @output.string
|
160
|
-
end
|
161
|
-
|
162
|
-
def test_display_list_lower_alpha
|
163
|
-
list = RDoc::Markup::Flow::LIST.new :LOWERALPHA
|
164
|
-
list << RDoc::Markup::Flow::LI.new(nil, 'a b c')
|
165
|
-
|
166
|
-
@f.display_list list
|
167
|
-
|
168
|
-
assert_equal " a. a b c\n\n", @output.string
|
169
|
-
end
|
170
|
-
|
171
|
-
def test_display_list_note
|
172
|
-
list = RDoc::Markup::Flow::LIST.new :NOTE
|
173
|
-
list << RDoc::Markup::Flow::LI.new('note:', 'a b c')
|
174
|
-
|
175
|
-
@f.display_list list
|
176
|
-
|
177
|
-
assert_equal " note: a b c\n\n", @output.string
|
178
|
-
end
|
179
|
-
|
180
|
-
def test_display_list_number
|
181
|
-
list = RDoc::Markup::Flow::LIST.new :NUMBER
|
182
|
-
list << RDoc::Markup::Flow::LI.new(nil, 'a b c')
|
183
|
-
|
184
|
-
@f.display_list list
|
185
|
-
|
186
|
-
assert_equal " 1. a b c\n\n", @output.string
|
187
|
-
end
|
188
|
-
|
189
|
-
def test_display_list_unknown
|
190
|
-
list = RDoc::Markup::Flow::LIST.new :UNKNOWN
|
191
|
-
list << RDoc::Markup::Flow::LI.new(nil, 'a b c')
|
192
|
-
|
193
|
-
e = assert_raises ArgumentError do
|
194
|
-
@f.display_list list
|
195
|
-
end
|
196
|
-
|
197
|
-
assert_equal 'unknown list type UNKNOWN', e.message
|
198
|
-
end
|
199
|
-
|
200
|
-
def test_display_list_upper_alpha
|
201
|
-
list = RDoc::Markup::Flow::LIST.new :UPPERALPHA
|
202
|
-
list << RDoc::Markup::Flow::LI.new(nil, 'a b c')
|
203
|
-
|
204
|
-
@f.display_list list
|
205
|
-
|
206
|
-
assert_equal " A. a b c\n\n", @output.string
|
207
|
-
end
|
208
|
-
|
209
|
-
def test_display_verbatim_flow_item
|
210
|
-
verbatim = RDoc::Markup::Flow::VERB.new "a b c\nd e f"
|
211
|
-
|
212
|
-
@f.display_verbatim_flow_item verbatim
|
213
|
-
|
214
|
-
assert_equal " a b c\n d e f\n\n", @output.string
|
215
|
-
end
|
216
|
-
|
217
|
-
def test_display_verbatim_flow_item_bold
|
218
|
-
verbatim = RDoc::Markup::Flow::VERB.new "*a* b c"
|
219
|
-
|
220
|
-
@f.display_verbatim_flow_item verbatim
|
221
|
-
|
222
|
-
assert_equal " *a* b c\n\n", @output.string
|
223
|
-
end
|
224
|
-
|
225
|
-
def test_draw_line
|
226
|
-
@f.draw_line
|
227
|
-
|
228
|
-
expected = '-' * @width + "\n"
|
229
|
-
assert_equal expected, @output.string
|
230
|
-
end
|
231
|
-
|
232
|
-
def test_draw_line_label
|
233
|
-
@f.draw_line 'label'
|
234
|
-
|
235
|
-
expected = '-' * (@width - 6) + " label\n"
|
236
|
-
assert_equal expected, @output.string
|
237
|
-
end
|
238
|
-
|
239
|
-
def test_draw_line_label_long
|
240
|
-
@f.draw_line 'a' * @width
|
241
|
-
|
242
|
-
expected = '-' * @width + "\n" + ('a' * @width) + "\n"
|
243
|
-
assert_equal expected, @output.string
|
244
|
-
end
|
245
|
-
|
246
|
-
def test_raw_print_line
|
247
|
-
@f.raw_print_line 'a b c'
|
248
|
-
|
249
|
-
assert_equal "a b c", @output.string
|
250
|
-
end
|
251
|
-
|
252
|
-
def test_strip_attributes_b
|
253
|
-
text = @f.strip_attributes 'hello <b>world</b>'
|
254
|
-
|
255
|
-
expected = 'hello world'
|
256
|
-
|
257
|
-
assert_equal expected, text
|
258
|
-
end
|
259
|
-
|
260
|
-
def test_strip_attributes_code
|
261
|
-
text = @f.strip_attributes 'hello <code>world</code>'
|
262
|
-
|
263
|
-
expected = 'hello world'
|
264
|
-
|
265
|
-
assert_equal expected, text
|
266
|
-
end
|
267
|
-
|
268
|
-
def test_strip_attributes_em
|
269
|
-
text = @f.strip_attributes 'hello <em>world</em>'
|
270
|
-
|
271
|
-
expected = 'hello world'
|
272
|
-
|
273
|
-
assert_equal expected, text
|
274
|
-
end
|
275
|
-
|
276
|
-
def test_strip_attributes_i
|
277
|
-
text = @f.strip_attributes 'hello <i>world</i>'
|
278
|
-
|
279
|
-
expected = 'hello world'
|
280
|
-
|
281
|
-
assert_equal expected, text
|
282
|
-
end
|
283
|
-
|
284
|
-
def test_strip_attributes_tt
|
285
|
-
text = @f.strip_attributes 'hello <tt>world</tt>'
|
286
|
-
|
287
|
-
expected = 'hello world'
|
288
|
-
|
289
|
-
assert_equal expected, text
|
290
|
-
end
|
291
|
-
|
292
|
-
def test_wrap_empty
|
293
|
-
@f.wrap ''
|
294
|
-
assert_equal '', @output.string
|
295
|
-
end
|
296
|
-
|
297
|
-
def test_wrap_long
|
298
|
-
@f.wrap 'a ' * (@width / 2)
|
299
|
-
assert_equal " a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a\n a \n",
|
300
|
-
@output.string
|
301
|
-
end
|
302
|
-
|
303
|
-
def test_wrap_markup
|
304
|
-
@f.wrap 'a <tt>b</tt> c'
|
305
|
-
assert_equal " a +b+ c\n", @output.string
|
306
|
-
end
|
307
|
-
|
308
|
-
def test_wrap_nil
|
309
|
-
@f.wrap nil
|
310
|
-
assert_equal '', @output.string
|
311
|
-
end
|
312
|
-
|
313
|
-
def test_wrap_short
|
314
|
-
@f.wrap 'a b c'
|
315
|
-
assert_equal " a b c\n", @output.string
|
316
|
-
end
|
317
|
-
|
318
|
-
end
|
319
|
-
|
320
|
-
MiniTest::Unit.autorun
|
@@ -1,141 +0,0 @@
|
|
1
|
-
require 'stringio'
|
2
|
-
require 'rubygems'
|
3
|
-
require 'minitest/unit'
|
4
|
-
require 'rdoc/ri/formatter'
|
5
|
-
require 'rdoc/markup/fragments'
|
6
|
-
require 'rdoc/markup/to_flow'
|
7
|
-
|
8
|
-
class TestRDocRIHtmlFormatter < MiniTest::Unit::TestCase
|
9
|
-
|
10
|
-
def setup
|
11
|
-
@output = StringIO.new
|
12
|
-
@width = 78
|
13
|
-
@indent = ' '
|
14
|
-
|
15
|
-
@f = RDoc::RI::HtmlFormatter.new @output, @width, @indent
|
16
|
-
@markup = RDoc::Markup.new
|
17
|
-
@flow = RDoc::Markup::ToFlow.new
|
18
|
-
@af = RDoc::RI::AttributeFormatter
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_blankline
|
22
|
-
@f.blankline
|
23
|
-
|
24
|
-
assert_equal "<p />\n", @output.string
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_bold_print
|
28
|
-
@f.bold_print 'text'
|
29
|
-
|
30
|
-
assert_equal '<b>text</b>', @output.string
|
31
|
-
end
|
32
|
-
|
33
|
-
def test_break_to_newline
|
34
|
-
@f.break_to_newline
|
35
|
-
|
36
|
-
assert_equal "<br />\n", @output.string
|
37
|
-
end
|
38
|
-
|
39
|
-
def test_display_heading
|
40
|
-
@f.display_heading 'text', 1, ' '
|
41
|
-
|
42
|
-
assert_equal "<h1>text</h1>\n", @output.string
|
43
|
-
end
|
44
|
-
|
45
|
-
def test_display_heading_level_4
|
46
|
-
@f.display_heading 'text', 4, ' '
|
47
|
-
|
48
|
-
assert_equal "<h4>text</h4>\n", @output.string
|
49
|
-
end
|
50
|
-
|
51
|
-
def test_display_heading_level_5
|
52
|
-
@f.display_heading 'text', 5, ' '
|
53
|
-
|
54
|
-
assert_equal "<h4>text</h4>\n", @output.string
|
55
|
-
end
|
56
|
-
|
57
|
-
def test_display_list_bullet
|
58
|
-
list = RDoc::Markup::Flow::LIST.new :BULLET
|
59
|
-
list << RDoc::Markup::Flow::LI.new(nil, 'a b c')
|
60
|
-
list << RDoc::Markup::Flow::LI.new(nil, 'd e f')
|
61
|
-
|
62
|
-
@f.display_list list
|
63
|
-
|
64
|
-
expected = <<-EOF.strip
|
65
|
-
<ul><li>a b c<p />
|
66
|
-
</li><li>d e f<p />
|
67
|
-
</li></ul>
|
68
|
-
EOF
|
69
|
-
|
70
|
-
assert_equal expected, @output.string
|
71
|
-
end
|
72
|
-
|
73
|
-
def test_display_list_number
|
74
|
-
list = RDoc::Markup::Flow::LIST.new :NUMBER
|
75
|
-
list << RDoc::Markup::Flow::LI.new(nil, 'a b c')
|
76
|
-
list << RDoc::Markup::Flow::LI.new(nil, 'd e f')
|
77
|
-
|
78
|
-
@f.display_list list
|
79
|
-
|
80
|
-
expected = <<-EOF.strip
|
81
|
-
<ol><li>a b c<p />
|
82
|
-
</li><li>d e f<p />
|
83
|
-
</li></ol>
|
84
|
-
EOF
|
85
|
-
|
86
|
-
assert_equal expected, @output.string
|
87
|
-
end
|
88
|
-
|
89
|
-
def test_display_list_labeled
|
90
|
-
list = RDoc::Markup::Flow::LIST.new :LABELED
|
91
|
-
list << RDoc::Markup::Flow::LI.new('label', 'a b c')
|
92
|
-
list << RDoc::Markup::Flow::LI.new('label 2', 'd e f')
|
93
|
-
|
94
|
-
@f.display_list list
|
95
|
-
|
96
|
-
expected = <<-EOF.strip
|
97
|
-
<dl><dt><b>label</b></dt><dd>a b c<p />
|
98
|
-
</dd><dt><b>label 2</b></dt><dd>d e f<p />
|
99
|
-
</dd></dl>
|
100
|
-
EOF
|
101
|
-
|
102
|
-
assert_equal expected, @output.string
|
103
|
-
end
|
104
|
-
|
105
|
-
def test_display_list_note
|
106
|
-
list = RDoc::Markup::Flow::LIST.new :NOTE
|
107
|
-
list << RDoc::Markup::Flow::LI.new('note:', 'a b c')
|
108
|
-
list << RDoc::Markup::Flow::LI.new('note 2:', 'd e f')
|
109
|
-
|
110
|
-
@f.display_list list
|
111
|
-
|
112
|
-
expected = <<-EOF.strip
|
113
|
-
<table><tr valign="top"><td>note:</td><td>a b c<p />
|
114
|
-
</td></tr><tr valign="top"><td>note 2:</td><td>d e f<p />
|
115
|
-
</td></tr></table>
|
116
|
-
EOF
|
117
|
-
|
118
|
-
assert_equal expected, @output.string
|
119
|
-
end
|
120
|
-
|
121
|
-
def test_display_verbatim_flow_item
|
122
|
-
verbatim = RDoc::Markup::Flow::VERB.new '*a* > b > c'
|
123
|
-
@f.display_verbatim_flow_item verbatim
|
124
|
-
|
125
|
-
assert_equal "<pre>*a* > b &gt; c\n</pre>\n", @output.string
|
126
|
-
end
|
127
|
-
|
128
|
-
def test_draw_line
|
129
|
-
@f.draw_line
|
130
|
-
|
131
|
-
assert_equal "<hr />\n", @output.string
|
132
|
-
end
|
133
|
-
|
134
|
-
def test_draw_line_label
|
135
|
-
@f.draw_line 'label'
|
136
|
-
|
137
|
-
assert_equal "<b>label</b><hr />\n", @output.string
|
138
|
-
end
|
139
|
-
|
140
|
-
end
|
141
|
-
|