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.

Files changed (248) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +13 -0
  3. data/.travis.yml +23 -0
  4. data/CONTRIBUTING.rdoc +4 -3
  5. data/Gemfile +3 -0
  6. data/History.rdoc +15 -4
  7. data/LEGAL.rdoc +2 -2
  8. data/README.rdoc +1 -0
  9. data/Rakefile +41 -79
  10. data/bin/console +7 -0
  11. data/bin/setup +6 -0
  12. data/{bin → exe}/rdoc +0 -0
  13. data/{bin → exe}/ri +0 -0
  14. data/lib/rdoc.rb +2 -1
  15. data/lib/rdoc/alias.rb +1 -0
  16. data/lib/rdoc/anon_class.rb +1 -0
  17. data/lib/rdoc/any_method.rb +1 -0
  18. data/lib/rdoc/attr.rb +1 -0
  19. data/lib/rdoc/class_module.rb +1 -0
  20. data/lib/rdoc/code_object.rb +1 -0
  21. data/lib/rdoc/code_objects.rb +1 -0
  22. data/lib/rdoc/comment.rb +1 -0
  23. data/lib/rdoc/constant.rb +1 -0
  24. data/lib/rdoc/context.rb +4 -1
  25. data/lib/rdoc/context/section.rb +7 -0
  26. data/lib/rdoc/cross_reference.rb +1 -0
  27. data/lib/rdoc/encoding.rb +14 -0
  28. data/lib/rdoc/erb_partial.rb +1 -0
  29. data/lib/rdoc/erbio.rb +1 -0
  30. data/lib/rdoc/extend.rb +1 -0
  31. data/lib/rdoc/generator.rb +1 -0
  32. data/lib/rdoc/generator/darkfish.rb +1 -0
  33. data/lib/rdoc/generator/json_index.rb +1 -0
  34. data/lib/rdoc/generator/markup.rb +1 -0
  35. data/lib/rdoc/generator/pot.rb +1 -0
  36. data/lib/rdoc/generator/pot/message_extractor.rb +1 -0
  37. data/lib/rdoc/generator/pot/po.rb +1 -0
  38. data/lib/rdoc/generator/pot/po_entry.rb +1 -0
  39. data/lib/rdoc/generator/ri.rb +1 -0
  40. data/lib/rdoc/generator/template/darkfish/_head.rhtml +2 -1
  41. data/lib/rdoc/generator/template/darkfish/css/fonts.css +6 -6
  42. data/lib/rdoc/generator/template/darkfish/js/darkfish.js +7 -7
  43. data/lib/rdoc/generator/template/json_index/js/searcher.js +1 -0
  44. data/lib/rdoc/ghost_method.rb +1 -0
  45. data/lib/rdoc/i18n.rb +1 -0
  46. data/lib/rdoc/i18n/locale.rb +1 -0
  47. data/lib/rdoc/i18n/text.rb +1 -0
  48. data/lib/rdoc/include.rb +1 -0
  49. data/lib/rdoc/known_classes.rb +1 -0
  50. data/lib/rdoc/markdown.kpeg +2 -6
  51. data/lib/rdoc/markdown.rb +2 -6
  52. data/lib/rdoc/markdown/entities.rb +1 -0
  53. data/lib/rdoc/markdown/{literals_1_9.kpeg → literals.kpeg} +0 -0
  54. data/lib/rdoc/markdown/{literals_1_9.rb → literals.rb} +1 -4
  55. data/lib/rdoc/markup.rb +1 -0
  56. data/lib/rdoc/markup/attr_changer.rb +1 -0
  57. data/lib/rdoc/markup/attr_span.rb +1 -0
  58. data/lib/rdoc/markup/attribute_manager.rb +1 -0
  59. data/lib/rdoc/markup/attributes.rb +1 -0
  60. data/lib/rdoc/markup/blank_line.rb +1 -0
  61. data/lib/rdoc/markup/block_quote.rb +1 -0
  62. data/lib/rdoc/markup/document.rb +1 -0
  63. data/lib/rdoc/markup/formatter.rb +1 -0
  64. data/lib/rdoc/markup/formatter_test_case.rb +1 -4
  65. data/lib/rdoc/markup/hard_break.rb +1 -0
  66. data/lib/rdoc/markup/heading.rb +1 -0
  67. data/lib/rdoc/markup/include.rb +1 -0
  68. data/lib/rdoc/markup/indented_paragraph.rb +1 -0
  69. data/lib/rdoc/markup/inline.rb +1 -0
  70. data/lib/rdoc/markup/list.rb +1 -0
  71. data/lib/rdoc/markup/list_item.rb +1 -0
  72. data/lib/rdoc/markup/paragraph.rb +1 -0
  73. data/lib/rdoc/markup/parser.rb +1 -0
  74. data/lib/rdoc/markup/pre_process.rb +1 -0
  75. data/lib/rdoc/markup/raw.rb +1 -0
  76. data/lib/rdoc/markup/rule.rb +1 -0
  77. data/lib/rdoc/markup/special.rb +1 -0
  78. data/lib/rdoc/markup/text_formatter_test_case.rb +1 -0
  79. data/lib/rdoc/markup/to_ansi.rb +1 -0
  80. data/lib/rdoc/markup/to_bs.rb +1 -0
  81. data/lib/rdoc/markup/to_html.rb +1 -0
  82. data/lib/rdoc/markup/to_html_crossref.rb +1 -0
  83. data/lib/rdoc/markup/to_html_snippet.rb +1 -0
  84. data/lib/rdoc/markup/to_joined_paragraph.rb +1 -0
  85. data/lib/rdoc/markup/to_label.rb +1 -0
  86. data/lib/rdoc/markup/to_markdown.rb +1 -0
  87. data/lib/rdoc/markup/to_rdoc.rb +1 -0
  88. data/lib/rdoc/markup/to_table_of_contents.rb +1 -0
  89. data/lib/rdoc/markup/to_test.rb +1 -0
  90. data/lib/rdoc/markup/to_tt_only.rb +1 -0
  91. data/lib/rdoc/markup/verbatim.rb +1 -0
  92. data/lib/rdoc/meta_method.rb +1 -0
  93. data/lib/rdoc/method_attr.rb +1 -0
  94. data/lib/rdoc/mixin.rb +1 -0
  95. data/lib/rdoc/normal_class.rb +1 -0
  96. data/lib/rdoc/normal_module.rb +1 -0
  97. data/lib/rdoc/options.rb +1 -0
  98. data/lib/rdoc/parser.rb +1 -0
  99. data/lib/rdoc/parser/c.rb +76 -33
  100. data/lib/rdoc/parser/changelog.rb +7 -1
  101. data/lib/rdoc/parser/markdown.rb +1 -0
  102. data/lib/rdoc/parser/rd.rb +1 -0
  103. data/lib/rdoc/parser/ruby.rb +1 -0
  104. data/lib/rdoc/parser/ruby_tools.rb +1 -0
  105. data/lib/rdoc/parser/simple.rb +1 -0
  106. data/lib/rdoc/parser/text.rb +1 -0
  107. data/lib/rdoc/rd.rb +1 -0
  108. data/lib/rdoc/rd/inline.rb +1 -0
  109. data/lib/rdoc/rdoc.rb +2 -1
  110. data/lib/rdoc/require.rb +1 -0
  111. data/lib/rdoc/ri.rb +1 -0
  112. data/lib/rdoc/ri/driver.rb +5 -19
  113. data/lib/rdoc/ri/formatter.rb +1 -0
  114. data/lib/rdoc/ri/paths.rb +1 -0
  115. data/lib/rdoc/ri/store.rb +1 -0
  116. data/lib/rdoc/ri/task.rb +72 -0
  117. data/lib/rdoc/ruby_lex.rb +11 -17
  118. data/lib/rdoc/ruby_token.rb +1 -0
  119. data/lib/rdoc/rubygems_hook.rb +1 -0
  120. data/lib/rdoc/servlet.rb +4 -3
  121. data/lib/rdoc/single_class.rb +1 -0
  122. data/lib/rdoc/stats.rb +1 -0
  123. data/lib/rdoc/stats/normal.rb +1 -0
  124. data/lib/rdoc/stats/quiet.rb +1 -0
  125. data/lib/rdoc/stats/verbose.rb +1 -0
  126. data/lib/rdoc/store.rb +3 -9
  127. data/lib/rdoc/task.rb +1 -0
  128. data/lib/rdoc/test_case.rb +1 -10
  129. data/lib/rdoc/text.rb +1 -0
  130. data/lib/rdoc/token_stream.rb +1 -0
  131. data/lib/rdoc/tom_doc.rb +1 -0
  132. data/lib/rdoc/top_level.rb +1 -0
  133. data/rdoc.gemspec +60 -0
  134. metadata +32 -155
  135. data/Manifest.txt +0 -309
  136. data/lib/rdoc/markdown/literals_1_8.kpeg +0 -18
  137. data/lib/rdoc/markdown/literals_1_8.rb +0 -416
  138. data/test/MarkdownTest_1.0.3/Amps and angle encoding.text +0 -21
  139. data/test/MarkdownTest_1.0.3/Auto links.text +0 -13
  140. data/test/MarkdownTest_1.0.3/Backslash escapes.text +0 -120
  141. data/test/MarkdownTest_1.0.3/Blockquotes with code blocks.text +0 -11
  142. data/test/MarkdownTest_1.0.3/Code Blocks.text +0 -14
  143. data/test/MarkdownTest_1.0.3/Code Spans.text +0 -6
  144. data/test/MarkdownTest_1.0.3/Hard-wrapped paragraphs with list-like lines.text +0 -8
  145. data/test/MarkdownTest_1.0.3/Horizontal rules.text +0 -67
  146. data/test/MarkdownTest_1.0.3/Inline HTML (Advanced).text +0 -15
  147. data/test/MarkdownTest_1.0.3/Inline HTML (Simple).text +0 -69
  148. data/test/MarkdownTest_1.0.3/Inline HTML comments.text +0 -13
  149. data/test/MarkdownTest_1.0.3/Links, inline style.text +0 -12
  150. data/test/MarkdownTest_1.0.3/Links, reference style.text +0 -71
  151. data/test/MarkdownTest_1.0.3/Links, shortcut references.text +0 -20
  152. data/test/MarkdownTest_1.0.3/Literal quotes in titles.text +0 -7
  153. data/test/MarkdownTest_1.0.3/Markdown Documentation - Basics.text +0 -306
  154. data/test/MarkdownTest_1.0.3/Markdown Documentation - Syntax.text +0 -888
  155. data/test/MarkdownTest_1.0.3/Nested blockquotes.text +0 -5
  156. data/test/MarkdownTest_1.0.3/Ordered and unordered lists.text +0 -131
  157. data/test/MarkdownTest_1.0.3/Strong and em together.text +0 -7
  158. data/test/MarkdownTest_1.0.3/Tabs.text +0 -21
  159. data/test/MarkdownTest_1.0.3/Tidyness.text +0 -5
  160. data/test/README +0 -1
  161. data/test/binary.dat +0 -0
  162. data/test/hidden.zip.txt +0 -1
  163. data/test/test.ja.largedoc +0 -3
  164. data/test/test.ja.rdoc +0 -10
  165. data/test/test.ja.txt +0 -8
  166. data/test/test.txt +0 -1
  167. data/test/test_rdoc_alias.rb +0 -13
  168. data/test/test_rdoc_any_method.rb +0 -460
  169. data/test/test_rdoc_attr.rb +0 -190
  170. data/test/test_rdoc_class_module.rb +0 -1492
  171. data/test/test_rdoc_code_object.rb +0 -450
  172. data/test/test_rdoc_comment.rb +0 -504
  173. data/test/test_rdoc_constant.rb +0 -181
  174. data/test/test_rdoc_context.rb +0 -901
  175. data/test/test_rdoc_context_section.rb +0 -130
  176. data/test/test_rdoc_cross_reference.rb +0 -192
  177. data/test/test_rdoc_encoding.rb +0 -227
  178. data/test/test_rdoc_extend.rb +0 -94
  179. data/test/test_rdoc_generator_darkfish.rb +0 -229
  180. data/test/test_rdoc_generator_json_index.rb +0 -324
  181. data/test/test_rdoc_generator_markup.rb +0 -59
  182. data/test/test_rdoc_generator_pot.rb +0 -91
  183. data/test/test_rdoc_generator_pot_po.rb +0 -51
  184. data/test/test_rdoc_generator_pot_po_entry.rb +0 -139
  185. data/test/test_rdoc_generator_ri.rb +0 -78
  186. data/test/test_rdoc_i18n_locale.rb +0 -73
  187. data/test/test_rdoc_i18n_text.rb +0 -123
  188. data/test/test_rdoc_include.rb +0 -108
  189. data/test/test_rdoc_markdown.rb +0 -980
  190. data/test/test_rdoc_markdown_test.rb +0 -1884
  191. data/test/test_rdoc_markup.rb +0 -95
  192. data/test/test_rdoc_markup_attribute_manager.rb +0 -364
  193. data/test/test_rdoc_markup_attributes.rb +0 -39
  194. data/test/test_rdoc_markup_document.rb +0 -207
  195. data/test/test_rdoc_markup_formatter.rb +0 -175
  196. data/test/test_rdoc_markup_hard_break.rb +0 -31
  197. data/test/test_rdoc_markup_heading.rb +0 -29
  198. data/test/test_rdoc_markup_include.rb +0 -19
  199. data/test/test_rdoc_markup_indented_paragraph.rb +0 -53
  200. data/test/test_rdoc_markup_paragraph.rb +0 -32
  201. data/test/test_rdoc_markup_parser.rb +0 -1680
  202. data/test/test_rdoc_markup_pre_process.rb +0 -473
  203. data/test/test_rdoc_markup_raw.rb +0 -22
  204. data/test/test_rdoc_markup_to_ansi.rb +0 -369
  205. data/test/test_rdoc_markup_to_bs.rb +0 -366
  206. data/test/test_rdoc_markup_to_html.rb +0 -662
  207. data/test/test_rdoc_markup_to_html_crossref.rb +0 -225
  208. data/test/test_rdoc_markup_to_html_snippet.rb +0 -711
  209. data/test/test_rdoc_markup_to_joined_paragraph.rb +0 -32
  210. data/test/test_rdoc_markup_to_label.rb +0 -112
  211. data/test/test_rdoc_markup_to_markdown.rb +0 -389
  212. data/test/test_rdoc_markup_to_rdoc.rb +0 -377
  213. data/test/test_rdoc_markup_to_table_of_contents.rb +0 -126
  214. data/test/test_rdoc_markup_to_tt_only.rb +0 -246
  215. data/test/test_rdoc_markup_verbatim.rb +0 -29
  216. data/test/test_rdoc_method_attr.rb +0 -193
  217. data/test/test_rdoc_normal_class.rb +0 -47
  218. data/test/test_rdoc_normal_module.rb +0 -42
  219. data/test/test_rdoc_options.rb +0 -766
  220. data/test/test_rdoc_parser.rb +0 -327
  221. data/test/test_rdoc_parser_c.rb +0 -1896
  222. data/test/test_rdoc_parser_changelog.rb +0 -315
  223. data/test/test_rdoc_parser_markdown.rb +0 -61
  224. data/test/test_rdoc_parser_rd.rb +0 -55
  225. data/test/test_rdoc_parser_ruby.rb +0 -3322
  226. data/test/test_rdoc_parser_simple.rb +0 -115
  227. data/test/test_rdoc_rd.rb +0 -30
  228. data/test/test_rdoc_rd_block_parser.rb +0 -535
  229. data/test/test_rdoc_rd_inline.rb +0 -63
  230. data/test/test_rdoc_rd_inline_parser.rb +0 -177
  231. data/test/test_rdoc_rdoc.rb +0 -455
  232. data/test/test_rdoc_require.rb +0 -25
  233. data/test/test_rdoc_ri_driver.rb +0 -1436
  234. data/test/test_rdoc_ri_paths.rb +0 -155
  235. data/test/test_rdoc_ruby_lex.rb +0 -421
  236. data/test/test_rdoc_ruby_token.rb +0 -19
  237. data/test/test_rdoc_rubygems_hook.rb +0 -251
  238. data/test/test_rdoc_servlet.rb +0 -534
  239. data/test/test_rdoc_single_class.rb +0 -20
  240. data/test/test_rdoc_stats.rb +0 -722
  241. data/test/test_rdoc_store.rb +0 -993
  242. data/test/test_rdoc_task.rb +0 -173
  243. data/test/test_rdoc_text.rb +0 -557
  244. data/test/test_rdoc_token_stream.rb +0 -42
  245. data/test/test_rdoc_tom_doc.rb +0 -520
  246. data/test/test_rdoc_top_level.rb +0 -287
  247. data/test/xref_data.rb +0 -76
  248. data/test/xref_test_case.rb +0 -67
@@ -1,20 +0,0 @@
1
- require 'rdoc/test_case'
2
-
3
- class TestRDocSingleClass < RDoc::TestCase
4
-
5
- def setup
6
- super
7
-
8
- @c = RDoc::SingleClass.new 'C'
9
- end
10
-
11
- def test_aref_prefix
12
- assert_equal 'sclass', @c.aref_prefix
13
- end
14
-
15
- def test_definition
16
- assert_equal 'class << C', @c.definition
17
- end
18
-
19
- end
20
-
@@ -1,722 +0,0 @@
1
- require 'rdoc/test_case'
2
-
3
- class TestRDocStats < RDoc::TestCase
4
-
5
- def setup
6
- super
7
-
8
- @s = RDoc::Stats.new @store, 0
9
-
10
- @tl = @store.add_file 'file.rb'
11
- @tl.parser = RDoc::Parser::Ruby
12
- end
13
-
14
- def test_doc_stats
15
- c = RDoc::CodeObject.new
16
-
17
- assert_equal [1, 1], @s.doc_stats([c])
18
- end
19
-
20
- def test_doc_stats_documented
21
- c = RDoc::CodeObject.new
22
- c.comment = comment 'x'
23
-
24
- assert_equal [1, 0], @s.doc_stats([c])
25
- end
26
-
27
- def test_doc_stats_display_eh
28
- c = RDoc::CodeObject.new
29
- c.ignore
30
-
31
- assert_equal [0, 0], @s.doc_stats([c])
32
- end
33
-
34
- def test_report_attr
35
- c = @tl.add_class RDoc::NormalClass, 'C'
36
- c.record_location @tl
37
- c.add_comment 'C', @tl
38
-
39
- a = RDoc::Attr.new nil, 'a', 'RW', nil
40
- a.record_location @tl
41
- c.add_attribute a
42
-
43
- @store.complete :public
44
-
45
- report = @s.report
46
-
47
- expected =
48
- doc(
49
- para('The following items are not documented:'),
50
- blank_line,
51
- verb(
52
- "class C # is documented\n",
53
- "\n",
54
- " attr_accessor :a # in file file.rb\n",
55
- "\n",
56
- "end\n"),
57
- blank_line)
58
-
59
- assert_equal expected, report
60
- end
61
-
62
- def test_report_attr_documented
63
- c = @tl.add_class RDoc::NormalClass, 'C'
64
- c.record_location @tl
65
- c.add_comment 'C', @tl
66
-
67
- a = RDoc::Attr.new nil, 'a', 'RW', 'a'
68
- a.record_location @tl
69
- c.add_attribute a
70
-
71
- @store.complete :public
72
-
73
- report = @s.report
74
-
75
- assert_equal @s.great_job, report
76
- end
77
-
78
- def test_report_attr_line
79
- c = @tl.add_class RDoc::NormalClass, 'C'
80
- c.record_location @tl
81
- c.add_comment 'C', @tl
82
-
83
- a = RDoc::Attr.new nil, 'a', 'RW', nil
84
- a.record_location @tl
85
- a.line = 3
86
- c.add_attribute a
87
-
88
- @store.complete :public
89
-
90
- assert_match '# in file file.rb:3', @s.report.accept(to_rdoc)
91
- end
92
-
93
- def test_report_constant
94
- m = @tl.add_module RDoc::NormalModule, 'M'
95
- m.record_location @tl
96
- m.add_comment 'M', @tl
97
-
98
- c = RDoc::Constant.new 'C', nil, nil
99
- c.record_location @tl
100
- m.add_constant c
101
-
102
- @store.complete :public
103
-
104
- report = @s.report
105
-
106
- expected =
107
- doc(
108
- para('The following items are not documented:'),
109
- blank_line,
110
- verb(
111
- "module M # is documented\n",
112
- "\n",
113
- " # in file file.rb\n",
114
- " C = nil\n",
115
- "\n",
116
- "end\n"),
117
- blank_line)
118
-
119
- assert_equal expected, report
120
- end
121
-
122
- def test_report_constant_alias
123
- mod = @tl.add_module RDoc::NormalModule, 'M'
124
-
125
- c = @tl.add_class RDoc::NormalClass, 'C'
126
- mod.add_constant c
127
-
128
- ca = RDoc::Constant.new 'CA', nil, nil
129
- ca.is_alias_for = c
130
-
131
- @tl.add_constant ca
132
-
133
- @store.complete :public
134
-
135
- report = @s.report
136
-
137
- # TODO change this to refute match, aliases should be ignored as they are
138
- # programmer convenience constructs
139
- assert_match 'class Object', report.accept(to_rdoc)
140
- end
141
-
142
- def test_report_constant_documented
143
- m = @tl.add_module RDoc::NormalModule, 'M'
144
- m.record_location @tl
145
- m.add_comment 'M', @tl
146
-
147
- c = RDoc::Constant.new 'C', nil, 'C'
148
- c.record_location @tl
149
- m.add_constant c
150
-
151
- @store.complete :public
152
-
153
- report = @s.report
154
-
155
- assert_equal @s.great_job, report
156
- end
157
-
158
- def test_report_constant_line
159
- m = @tl.add_module RDoc::NormalModule, 'M'
160
- m.record_location @tl
161
- m.add_comment 'M', @tl
162
-
163
- c = RDoc::Constant.new 'C', nil, nil
164
- c.record_location @tl
165
- c.line = 5
166
- m.add_constant c
167
-
168
- @store.complete :public
169
-
170
- assert_match '# in file file.rb:5', @s.report.accept(to_rdoc)
171
- end
172
-
173
- def test_report_class
174
- c = @tl.add_class RDoc::NormalClass, 'C'
175
- c.record_location @tl
176
-
177
- m = RDoc::AnyMethod.new nil, 'm'
178
- m.record_location @tl
179
- c.add_method m
180
- m.comment = 'm'
181
-
182
- @store.complete :public
183
-
184
- report = @s.report
185
-
186
- expected =
187
- doc(
188
- para('The following items are not documented:'),
189
- blank_line,
190
- para('In files:'),
191
- list(:BULLET, *[
192
- item(nil, para('file.rb'))]),
193
- blank_line,
194
- verb("class C\n", "end\n"),
195
- blank_line)
196
-
197
- assert_equal expected, report
198
- end
199
-
200
- def test_report_skip_object
201
- c = @tl.add_class RDoc::NormalClass, 'Object'
202
- c.record_location @tl
203
-
204
- m = RDoc::AnyMethod.new nil, 'm'
205
- m.record_location @tl
206
- c.add_method m
207
- m.comment = 'm'
208
-
209
- @store.complete :public
210
-
211
- refute_match %r%^class Object$%, @s.report.accept(to_rdoc)
212
- end
213
-
214
- def test_report_class_documented
215
- c = @tl.add_class RDoc::NormalClass, 'C'
216
- c.record_location @tl
217
- c.add_comment 'C', @tl
218
-
219
- m = RDoc::AnyMethod.new nil, 'm'
220
- m.record_location @tl
221
- c.add_method m
222
- m.comment = 'm'
223
-
224
- @store.complete :public
225
-
226
- report = @s.report
227
-
228
- assert_equal @s.great_job, report
229
- end
230
-
231
- def test_report_class_documented_level_1
232
- c1 = @tl.add_class RDoc::NormalClass, 'C1'
233
- c1.record_location @tl
234
- c1.add_comment 'C1', @tl
235
-
236
- m1 = RDoc::AnyMethod.new nil, 'm1'
237
- m1.record_location @tl
238
- c1.add_method m1
239
- m1.comment = 'm1'
240
-
241
- c2 = @tl.add_class RDoc::NormalClass, 'C2'
242
- c2.record_location @tl
243
-
244
- m2 = RDoc::AnyMethod.new nil, 'm2'
245
- m2.record_location @tl
246
- c2.add_method m2
247
- m2.comment = 'm2'
248
-
249
- @store.complete :public
250
-
251
- @s.coverage_level = 1
252
-
253
- report = @s.report
254
-
255
- expected =
256
- doc(
257
- para('The following items are not documented:'),
258
- blank_line,
259
- para('In files:'),
260
- list(:BULLET, *[
261
- item(nil, para('file.rb'))]),
262
- blank_line,
263
- verb("class C2\n", "end\n"),
264
- blank_line)
265
-
266
- assert_equal expected, report
267
- end
268
-
269
- def test_report_class_empty
270
- @tl.add_class RDoc::NormalClass, 'C'
271
-
272
- @store.complete :public
273
-
274
- report = @s.report
275
-
276
- expected =
277
- doc(
278
- para('The following items are not documented:'),
279
- blank_line,
280
- para('class C is referenced but empty.'),
281
- para("It probably came from another project. I'm sorry I'm holding it against you."),
282
- blank_line)
283
-
284
- assert_equal expected, report
285
- end
286
-
287
- def test_report_class_empty_2
288
- c1 = @tl.add_class RDoc::NormalClass, 'C1'
289
- c1.record_location @tl
290
-
291
- c2 = @tl.add_class RDoc::NormalClass, 'C2'
292
- c2.record_location @tl
293
- c2.add_comment 'C2', @tl
294
-
295
- @store.complete :public
296
-
297
- @s.coverage_level = 1
298
- report = @s.report
299
-
300
- expected =
301
- doc(
302
- para('The following items are not documented:'),
303
- blank_line,
304
- para('In files:'),
305
- list(:BULLET, *[
306
- item(nil, para('file.rb'))]),
307
- blank_line,
308
- verb("class C1\n", "end\n"),
309
- blank_line)
310
-
311
- assert_equal expected, report
312
- end
313
-
314
- def test_report_class_method_documented
315
- c = @tl.add_class RDoc::NormalClass, 'C'
316
- c.record_location @tl
317
-
318
- m = RDoc::AnyMethod.new nil, 'm'
319
- m.record_location @tl
320
- c.add_method m
321
- m.comment = 'm'
322
-
323
- @store.complete :public
324
-
325
- report = @s.report
326
-
327
- expected =
328
- doc(
329
- para('The following items are not documented:'),
330
- blank_line,
331
- para('In files:'),
332
- list(:BULLET, *[
333
- item(nil, para('file.rb'))]),
334
- blank_line,
335
- verb("class C\n", "end\n"),
336
- blank_line)
337
-
338
- assert_equal expected, report
339
- end
340
-
341
- def test_report_class_module_ignore
342
- c = @tl.add_class RDoc::NormalClass, 'C'
343
- c.ignore
344
-
345
- @store.complete :public
346
-
347
- report = @s.report_class_module c
348
-
349
- assert_nil report
350
- end
351
-
352
- def test_report_empty
353
- @store.complete :public
354
-
355
- report = @s.report
356
-
357
- assert_equal @s.great_job, report
358
- end
359
-
360
- def test_report_method
361
- c = @tl.add_class RDoc::NormalClass, 'C'
362
- c.record_location @tl
363
- c.add_comment 'C', @tl
364
-
365
- m1 = RDoc::AnyMethod.new nil, 'm1'
366
- m1.record_location @tl
367
- c.add_method m1
368
-
369
- m2 = RDoc::AnyMethod.new nil, 'm2'
370
- m2.record_location @tl
371
- c.add_method m2
372
- m2.comment = 'm2'
373
-
374
- @store.complete :public
375
-
376
- report = @s.report
377
-
378
- expected =
379
- doc(
380
- para('The following items are not documented:'),
381
- blank_line,
382
- verb(*[
383
- "class C # is documented\n",
384
- "\n",
385
- " # in file file.rb\n",
386
- " def m1; end\n",
387
- "\n",
388
- "end\n"]),
389
- blank_line)
390
-
391
- assert_equal expected, report
392
- end
393
-
394
- def test_report_method_class
395
- c = @tl.add_class RDoc::NormalClass, 'C'
396
- c.record_location @tl
397
- c.add_comment 'C', @tl
398
-
399
- m1 = RDoc::AnyMethod.new nil, 'm1'
400
- m1.record_location @tl
401
- m1.singleton = true
402
- c.add_method m1
403
-
404
- m2 = RDoc::AnyMethod.new nil, 'm2'
405
- m2.record_location @tl
406
- m2.singleton = true
407
- c.add_method m2
408
- m2.comment = 'm2'
409
-
410
- @store.complete :public
411
-
412
- report = @s.report
413
-
414
- expected =
415
- doc(
416
- para('The following items are not documented:'),
417
- blank_line,
418
- verb(*[
419
- "class C # is documented\n",
420
- "\n",
421
- " # in file file.rb\n",
422
- " def self.m1; end\n",
423
- "\n",
424
- "end\n"]),
425
- blank_line)
426
-
427
- assert_equal expected, report
428
- end
429
-
430
- def test_report_method_documented
431
- c = @tl.add_class RDoc::NormalClass, 'C'
432
- c.record_location @tl
433
- c.add_comment 'C', @tl
434
-
435
- m = RDoc::AnyMethod.new nil, 'm'
436
- m.record_location @tl
437
- c.add_method m
438
- m.comment = 'm'
439
-
440
- @store.complete :public
441
-
442
- report = @s.report
443
-
444
- assert_equal @s.great_job, report
445
- end
446
-
447
- def test_report_method_line
448
- c = @tl.add_class RDoc::NormalClass, 'C'
449
- c.record_location @tl
450
- c.add_comment 'C', @tl
451
-
452
- m1 = RDoc::AnyMethod.new nil, 'm1'
453
- m1.record_location @tl
454
- m1.line = 4
455
- c.add_method m1
456
-
457
- @store.complete :public
458
-
459
- assert_match '# in file file.rb:4', @s.report.accept(to_rdoc)
460
- end
461
-
462
- def test_report_method_parameters
463
- c = @tl.add_class RDoc::NormalClass, 'C'
464
- c.record_location @tl
465
- c.add_comment 'C', @tl
466
-
467
- m1 = RDoc::AnyMethod.new nil, 'm1'
468
- m1.record_location @tl
469
- m1.params = '(p1, p2)'
470
- m1.comment = 'Stuff with +p1+'
471
- c.add_method m1
472
-
473
- m2 = RDoc::AnyMethod.new nil, 'm2'
474
- m2.record_location @tl
475
- c.add_method m2
476
- m2.comment = 'm2'
477
-
478
- @store.complete :public
479
-
480
- @s.coverage_level = 1
481
- report = @s.report
482
-
483
- expected =
484
- doc(
485
- para('The following items are not documented:'),
486
- blank_line,
487
- verb(*[
488
- "class C # is documented\n",
489
- "\n",
490
- " # in file file.rb\n",
491
- " # +p2+ is not documented\n",
492
- " def m1(p1, p2); end\n",
493
- "\n",
494
- "end\n"]),
495
- blank_line)
496
-
497
- assert_equal expected, report
498
- end
499
-
500
- def test_report_method_parameters_documented
501
- @tl.parser = RDoc::Parser::Ruby
502
- c = @tl.add_class RDoc::NormalClass, 'C'
503
- c.record_location @tl
504
- c.add_comment 'C', @tl
505
-
506
- m = RDoc::AnyMethod.new nil, 'm'
507
- m.record_location @tl
508
- m.params = '(p1)'
509
- m.comment = 'Stuff with +p1+'
510
- c.add_method m
511
-
512
- @store.complete :public
513
-
514
- @s.coverage_level = 1
515
- report = @s.report
516
-
517
- assert_equal @s.great_job, report
518
- end
519
-
520
- def test_report_method_parameters_yield
521
- c = @tl.add_class RDoc::NormalClass, 'C'
522
- c.record_location @tl
523
- c.add_comment 'C', @tl
524
-
525
- m = RDoc::AnyMethod.new nil, 'm'
526
- m.record_location @tl
527
- m.call_seq = <<-SEQ
528
- m(a) { |c| ... }
529
- m(a, b) { |c, d| ... }
530
- SEQ
531
- m.comment = 'Stuff with +a+, yields +c+ for you to do stuff with'
532
- c.add_method m
533
-
534
- @store.complete :public
535
-
536
- @s.coverage_level = 1
537
- report = @s.report
538
-
539
- expected =
540
- doc(
541
- para('The following items are not documented:'),
542
- blank_line,
543
- verb(
544
- "class C # is documented\n",
545
- "\n",
546
- " # in file file.rb\n",
547
- " # +b+, +d+ is not documented\n",
548
- " def m; end\n",
549
- "\n",
550
- "end\n"),
551
- blank_line)
552
-
553
- assert_equal expected, report
554
- end
555
-
556
- def test_summary
557
- c = @tl.add_class RDoc::NormalClass, 'C'
558
- c.record_location @tl
559
-
560
- m = @tl.add_module RDoc::NormalModule, 'M'
561
- m.record_location @tl
562
-
563
- a = RDoc::Attr.new nil, 'a', 'RW', nil
564
- a.record_location @tl
565
- c.add_attribute a
566
-
567
- c_c = RDoc::Constant.new 'C', nil, nil
568
- c_c.record_location @tl
569
- c.add_constant c_c
570
-
571
- m = RDoc::AnyMethod.new nil, 'm'
572
- m.record_location @tl
573
- c.add_method m
574
-
575
- @store.complete :public
576
-
577
- summary = @s.summary.accept to_rdoc
578
- summary.sub!(/ Elapsed:.*/m, '')
579
-
580
- expected = <<-EXPECTED
581
- Files: 0
582
-
583
- Classes: 1 (1 undocumented)
584
- Modules: 1 (1 undocumented)
585
- Constants: 1 (1 undocumented)
586
- Attributes: 1 (1 undocumented)
587
- Methods: 1 (1 undocumented)
588
-
589
- Total: 5 (5 undocumented)
590
- 0.00% documented
591
-
592
- EXPECTED
593
-
594
- assert_equal summary, expected
595
- end
596
-
597
- def test_summary_level_false
598
- c = @tl.add_class RDoc::NormalClass, 'C'
599
- c.record_location @tl
600
-
601
- @store.complete :public
602
-
603
- @s.coverage_level = false
604
-
605
- summary = @s.summary.accept to_rdoc
606
- summary.sub!(/ Elapsed:.*/m, '')
607
-
608
- expected = <<-EXPECTED
609
- Files: 0
610
-
611
- Classes: 1 (1 undocumented)
612
- Modules: 0 (0 undocumented)
613
- Constants: 0 (0 undocumented)
614
- Attributes: 0 (0 undocumented)
615
- Methods: 0 (0 undocumented)
616
-
617
- Total: 1 (1 undocumented)
618
- 0.00% documented
619
-
620
- EXPECTED
621
-
622
- assert_equal summary, expected
623
- end
624
-
625
- def test_summary_level_1
626
- c = @tl.add_class RDoc::NormalClass, 'C'
627
- c.record_location @tl
628
- c.add_comment 'C', @tl
629
-
630
- m = RDoc::AnyMethod.new nil, 'm'
631
- m.record_location @tl
632
- m.params = '(p1, p2)'
633
- m.comment = 'Stuff with +p1+'
634
- c.add_method m
635
-
636
- @store.complete :public
637
-
638
- @s.coverage_level = 1
639
- @s.report
640
-
641
- summary = @s.summary.accept to_rdoc
642
- summary.sub!(/ Elapsed:.*/m, '')
643
-
644
- expected = <<-EXPECTED
645
- Files: 0
646
-
647
- Classes: 1 (0 undocumented)
648
- Modules: 0 (0 undocumented)
649
- Constants: 0 (0 undocumented)
650
- Attributes: 0 (0 undocumented)
651
- Methods: 1 (0 undocumented)
652
- Parameters: 2 (1 undocumented)
653
-
654
- Total: 4 (1 undocumented)
655
- 75.00% documented
656
-
657
- EXPECTED
658
-
659
- assert_equal summary, expected
660
- end
661
-
662
- def to_rdoc
663
- RDoc::Markup::ToRdoc.new
664
- end
665
-
666
- def test_undoc_params
667
- method = RDoc::AnyMethod.new [], 'm'
668
- method.params = '(a)'
669
- method.comment = comment 'comment'
670
-
671
- total, undoc = @s.undoc_params method
672
-
673
- assert_equal 1, total
674
- assert_equal %w[a], undoc
675
- end
676
-
677
- def test_undoc_params_block
678
- method = RDoc::AnyMethod.new [], 'm'
679
- method.params = '(&a)'
680
- method.comment = comment '+a+'
681
-
682
- total, undoc = @s.undoc_params method
683
-
684
- assert_equal 1, total
685
- assert_empty undoc
686
- end
687
-
688
- def test_undoc_params_documented
689
- method = RDoc::AnyMethod.new [], 'm'
690
- method.params = '(a)'
691
- method.comment = comment '+a+'
692
-
693
- total, undoc = @s.undoc_params method
694
-
695
- assert_equal 1, total
696
- assert_empty undoc
697
- end
698
-
699
- def test_undoc_params_keywords
700
- method = RDoc::AnyMethod.new [], 'm'
701
- method.params = '(**a)'
702
- method.comment = comment '+a+'
703
-
704
- total, undoc = @s.undoc_params method
705
-
706
- assert_equal 1, total
707
- assert_empty undoc
708
- end
709
-
710
- def test_undoc_params_splat
711
- method = RDoc::AnyMethod.new [], 'm'
712
- method.params = '(*a)'
713
- method.comment = comment '+a+'
714
-
715
- total, undoc = @s.undoc_params method
716
-
717
- assert_equal 1, total
718
- assert_empty undoc
719
- end
720
-
721
- end
722
-