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,450 +0,0 @@
|
|
1
|
-
# coding: US-ASCII
|
2
|
-
|
3
|
-
require File.expand_path '../xref_test_case', __FILE__
|
4
|
-
|
5
|
-
class TestRDocCodeObject < XrefTestCase
|
6
|
-
|
7
|
-
def setup
|
8
|
-
super
|
9
|
-
|
10
|
-
@co = RDoc::CodeObject.new
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_initialize
|
14
|
-
assert @co.document_self, 'document_self'
|
15
|
-
assert @co.document_children, 'document_children'
|
16
|
-
refute @co.force_documentation, 'force_documentation'
|
17
|
-
refute @co.done_documenting, 'done_documenting'
|
18
|
-
refute @co.received_nodoc, 'received_nodoc'
|
19
|
-
assert_equal '', @co.comment, 'comment is empty'
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_comment_equals
|
23
|
-
@co.comment = ''
|
24
|
-
|
25
|
-
assert_equal '', @co.comment
|
26
|
-
|
27
|
-
@co.comment = 'I am a comment'
|
28
|
-
|
29
|
-
assert_equal 'I am a comment', @co.comment
|
30
|
-
end
|
31
|
-
|
32
|
-
def test_comment_equals_comment
|
33
|
-
@co.comment = comment ''
|
34
|
-
|
35
|
-
assert_equal '', @co.comment.text
|
36
|
-
|
37
|
-
@co.comment = comment 'I am a comment'
|
38
|
-
|
39
|
-
assert_equal 'I am a comment', @co.comment.text
|
40
|
-
end
|
41
|
-
|
42
|
-
def test_comment_equals_document
|
43
|
-
doc = RDoc::Markup::Document.new
|
44
|
-
@co.comment = doc
|
45
|
-
|
46
|
-
@co.comment = ''
|
47
|
-
|
48
|
-
assert_equal doc, @co.comment
|
49
|
-
end
|
50
|
-
|
51
|
-
def test_comment_equals_encoding
|
52
|
-
skip "Encoding not implemented" unless Object.const_defined? :Encoding
|
53
|
-
|
54
|
-
refute_equal Encoding::UTF_8, ''.encoding, 'Encoding sanity check'
|
55
|
-
|
56
|
-
input = 'text'
|
57
|
-
input.force_encoding Encoding::UTF_8
|
58
|
-
|
59
|
-
@co.comment = input
|
60
|
-
|
61
|
-
assert_equal 'text', @co.comment
|
62
|
-
assert_equal Encoding::UTF_8, @co.comment.encoding
|
63
|
-
end
|
64
|
-
|
65
|
-
def test_comment_equals_encoding_blank
|
66
|
-
skip "Encoding not implemented" unless Object.const_defined? :Encoding
|
67
|
-
|
68
|
-
refute_equal Encoding::UTF_8, ''.encoding, 'Encoding sanity check'
|
69
|
-
|
70
|
-
input = ''
|
71
|
-
input.force_encoding Encoding::UTF_8
|
72
|
-
|
73
|
-
@co.comment = input
|
74
|
-
|
75
|
-
assert_equal '', @co.comment
|
76
|
-
assert_equal Encoding::UTF_8, @co.comment.encoding
|
77
|
-
end
|
78
|
-
|
79
|
-
def test_display_eh_document_self
|
80
|
-
assert @co.display?
|
81
|
-
|
82
|
-
@co.document_self = false
|
83
|
-
|
84
|
-
refute @co.display?
|
85
|
-
end
|
86
|
-
|
87
|
-
def test_display_eh_ignore
|
88
|
-
assert @co.display?
|
89
|
-
|
90
|
-
@co.ignore
|
91
|
-
|
92
|
-
refute @co.display?
|
93
|
-
|
94
|
-
@co.stop_doc
|
95
|
-
|
96
|
-
refute @co.display?
|
97
|
-
|
98
|
-
@co.done_documenting = false
|
99
|
-
|
100
|
-
refute @co.display?
|
101
|
-
end
|
102
|
-
|
103
|
-
def test_display_eh_suppress
|
104
|
-
assert @co.display?
|
105
|
-
|
106
|
-
@co.suppress
|
107
|
-
|
108
|
-
refute @co.display?
|
109
|
-
|
110
|
-
@co.comment = comment('hi')
|
111
|
-
|
112
|
-
refute @co.display?
|
113
|
-
|
114
|
-
@co.done_documenting = false
|
115
|
-
|
116
|
-
assert @co.display?
|
117
|
-
|
118
|
-
@co.ignore
|
119
|
-
@co.done_documenting = false
|
120
|
-
|
121
|
-
refute @co.display?
|
122
|
-
end
|
123
|
-
|
124
|
-
def test_document_children_equals
|
125
|
-
@co.document_children = false
|
126
|
-
|
127
|
-
refute @co.document_children
|
128
|
-
|
129
|
-
@store.rdoc.options.visibility = :nodoc
|
130
|
-
|
131
|
-
@co.store = @store
|
132
|
-
|
133
|
-
assert @co.document_children
|
134
|
-
|
135
|
-
@co.document_children = false
|
136
|
-
|
137
|
-
assert @co.document_children
|
138
|
-
end
|
139
|
-
|
140
|
-
def test_document_self_equals
|
141
|
-
@co.document_self = false
|
142
|
-
refute @co.document_self
|
143
|
-
|
144
|
-
@store.rdoc.options.visibility = :nodoc
|
145
|
-
|
146
|
-
@co.store = @store
|
147
|
-
|
148
|
-
assert @co.document_self
|
149
|
-
|
150
|
-
@co.document_self = false
|
151
|
-
|
152
|
-
assert @co.document_self
|
153
|
-
end
|
154
|
-
|
155
|
-
def test_documented_eh
|
156
|
-
refute @co.documented?
|
157
|
-
|
158
|
-
@co.comment = 'hi'
|
159
|
-
|
160
|
-
assert @co.documented?
|
161
|
-
|
162
|
-
@co.comment.replace ''
|
163
|
-
|
164
|
-
refute @co.documented?
|
165
|
-
|
166
|
-
@co.document_self = nil # notify :nodoc:
|
167
|
-
|
168
|
-
assert @co.documented?
|
169
|
-
end
|
170
|
-
|
171
|
-
def test_done_documenting
|
172
|
-
# once done_documenting is set, other properties refuse to go to "true"
|
173
|
-
@co.done_documenting = true
|
174
|
-
|
175
|
-
@co.document_self = true
|
176
|
-
refute @co.document_self
|
177
|
-
|
178
|
-
@co.document_children = true
|
179
|
-
refute @co.document_children
|
180
|
-
|
181
|
-
@co.force_documentation = true
|
182
|
-
refute @co.force_documentation
|
183
|
-
|
184
|
-
@co.start_doc
|
185
|
-
refute @co.document_self
|
186
|
-
refute @co.document_children
|
187
|
-
|
188
|
-
# turning done_documenting on
|
189
|
-
# resets others to true
|
190
|
-
|
191
|
-
@co.done_documenting = false
|
192
|
-
assert @co.document_self
|
193
|
-
assert @co.document_children
|
194
|
-
|
195
|
-
@co.done_documenting = true
|
196
|
-
|
197
|
-
@store.rdoc.options.visibility = :nodoc
|
198
|
-
|
199
|
-
@co.store = @store
|
200
|
-
|
201
|
-
refute @co.done_documenting
|
202
|
-
|
203
|
-
@co.done_documenting = true
|
204
|
-
|
205
|
-
refute @co.done_documenting
|
206
|
-
end
|
207
|
-
|
208
|
-
def test_each_parent
|
209
|
-
parents = []
|
210
|
-
|
211
|
-
@parent_m.each_parent do |code_object|
|
212
|
-
parents << code_object
|
213
|
-
end
|
214
|
-
|
215
|
-
assert_equal [@parent, @xref_data], parents
|
216
|
-
end
|
217
|
-
|
218
|
-
def test_file_name
|
219
|
-
assert_equal nil, @co.file_name
|
220
|
-
|
221
|
-
@co.record_location @store.add_file 'lib/file.rb'
|
222
|
-
|
223
|
-
assert_equal 'lib/file.rb', @co.file_name
|
224
|
-
end
|
225
|
-
|
226
|
-
def test_full_name_equals
|
227
|
-
@co.full_name = 'hi'
|
228
|
-
|
229
|
-
assert_equal 'hi', @co.instance_variable_get(:@full_name)
|
230
|
-
|
231
|
-
@co.full_name = nil
|
232
|
-
|
233
|
-
assert_nil @co.instance_variable_get(:@full_name)
|
234
|
-
end
|
235
|
-
|
236
|
-
def test_ignore
|
237
|
-
@co.ignore
|
238
|
-
|
239
|
-
refute @co.document_self
|
240
|
-
refute @co.document_children
|
241
|
-
assert @co.ignored?
|
242
|
-
|
243
|
-
@store.rdoc.options.visibility = :nodoc
|
244
|
-
|
245
|
-
@co.store = @store
|
246
|
-
|
247
|
-
assert @co.document_self
|
248
|
-
assert @co.document_children
|
249
|
-
refute @co.ignored?
|
250
|
-
|
251
|
-
@co.ignore
|
252
|
-
|
253
|
-
refute @co.ignored?
|
254
|
-
end
|
255
|
-
|
256
|
-
def test_ignore_eh
|
257
|
-
refute @co.ignored?
|
258
|
-
|
259
|
-
@co.ignore
|
260
|
-
|
261
|
-
assert @co.ignored?
|
262
|
-
end
|
263
|
-
|
264
|
-
def test_line
|
265
|
-
@c1_m.line = 5
|
266
|
-
|
267
|
-
assert_equal 5, @c1_m.line
|
268
|
-
end
|
269
|
-
|
270
|
-
def test_metadata
|
271
|
-
assert_empty @co.metadata
|
272
|
-
|
273
|
-
@co.metadata['markup'] = 'not_rdoc'
|
274
|
-
|
275
|
-
expected = { 'markup' => 'not_rdoc' }
|
276
|
-
|
277
|
-
assert_equal expected, @co.metadata
|
278
|
-
|
279
|
-
assert_equal 'not_rdoc', @co.metadata['markup']
|
280
|
-
end
|
281
|
-
|
282
|
-
def test_offset
|
283
|
-
@c1_m.offset = 5
|
284
|
-
|
285
|
-
assert_equal 5, @c1_m.offset
|
286
|
-
end
|
287
|
-
|
288
|
-
def test_options
|
289
|
-
assert_kind_of RDoc::Options, @co.options
|
290
|
-
|
291
|
-
@co.store = @store
|
292
|
-
|
293
|
-
assert_same @options, @co.options
|
294
|
-
end
|
295
|
-
|
296
|
-
def test_parent_file_name
|
297
|
-
assert_equal '(unknown)', @co.parent_file_name
|
298
|
-
assert_equal 'xref_data.rb', @c1.parent_file_name
|
299
|
-
end
|
300
|
-
|
301
|
-
def test_parent_name
|
302
|
-
assert_equal '(unknown)', @co.parent_name
|
303
|
-
assert_equal 'xref_data.rb', @c1.parent_name
|
304
|
-
assert_equal 'C2', @c2_c3.parent_name
|
305
|
-
end
|
306
|
-
|
307
|
-
def test_received_ndoc
|
308
|
-
@co.document_self = false
|
309
|
-
refute @co.received_nodoc
|
310
|
-
|
311
|
-
@co.document_self = nil
|
312
|
-
assert @co.received_nodoc
|
313
|
-
|
314
|
-
@co.document_self = true
|
315
|
-
end
|
316
|
-
|
317
|
-
def test_record_location
|
318
|
-
@co.record_location @xref_data
|
319
|
-
|
320
|
-
assert_equal 'xref_data.rb', @co.file.relative_name
|
321
|
-
end
|
322
|
-
|
323
|
-
def test_record_location_ignored
|
324
|
-
@co.ignore
|
325
|
-
@co.record_location @xref_data
|
326
|
-
|
327
|
-
refute @co.ignored?
|
328
|
-
end
|
329
|
-
|
330
|
-
def test_record_location_suppressed
|
331
|
-
@co.suppress
|
332
|
-
@co.record_location @xref_data
|
333
|
-
|
334
|
-
refute @co.suppressed?
|
335
|
-
end
|
336
|
-
|
337
|
-
def test_section
|
338
|
-
parent = RDoc::Context.new
|
339
|
-
section = parent.sections.first
|
340
|
-
|
341
|
-
@co.parent = parent
|
342
|
-
@co.instance_variable_set :@section, section
|
343
|
-
|
344
|
-
assert_equal section, @co.section
|
345
|
-
|
346
|
-
@co.instance_variable_set :@section, nil
|
347
|
-
@co.instance_variable_set :@section_title, nil
|
348
|
-
|
349
|
-
assert_equal section, @co.section
|
350
|
-
|
351
|
-
@co.instance_variable_set :@section, nil
|
352
|
-
@co.instance_variable_set :@section_title, 'new title'
|
353
|
-
|
354
|
-
assert_equal 'new title', @co.section.title
|
355
|
-
end
|
356
|
-
|
357
|
-
def test_start_doc
|
358
|
-
@co.document_self = false
|
359
|
-
@co.document_children = false
|
360
|
-
|
361
|
-
@co.start_doc
|
362
|
-
|
363
|
-
assert @co.document_self
|
364
|
-
assert @co.document_children
|
365
|
-
end
|
366
|
-
|
367
|
-
def test_start_doc_ignored
|
368
|
-
@co.ignore
|
369
|
-
|
370
|
-
@co.start_doc
|
371
|
-
|
372
|
-
assert @co.document_self
|
373
|
-
assert @co.document_children
|
374
|
-
refute @co.ignored?
|
375
|
-
end
|
376
|
-
|
377
|
-
def test_start_doc_suppressed
|
378
|
-
@co.suppress
|
379
|
-
|
380
|
-
@co.start_doc
|
381
|
-
|
382
|
-
assert @co.document_self
|
383
|
-
assert @co.document_children
|
384
|
-
refute @co.suppressed?
|
385
|
-
end
|
386
|
-
|
387
|
-
def test_store_equals
|
388
|
-
@co.document_self = false
|
389
|
-
|
390
|
-
@co.store = @store
|
391
|
-
|
392
|
-
refute @co.document_self
|
393
|
-
|
394
|
-
@store.rdoc.options.visibility = :nodoc
|
395
|
-
|
396
|
-
@co.store = @store
|
397
|
-
|
398
|
-
assert @co.document_self
|
399
|
-
end
|
400
|
-
|
401
|
-
def test_stop_doc
|
402
|
-
@co.document_self = true
|
403
|
-
@co.document_children = true
|
404
|
-
|
405
|
-
@co.stop_doc
|
406
|
-
|
407
|
-
refute @co.document_self
|
408
|
-
refute @co.document_children
|
409
|
-
|
410
|
-
@store.rdoc.options.visibility = :nodoc
|
411
|
-
|
412
|
-
@co.store = @store
|
413
|
-
|
414
|
-
assert @co.document_self
|
415
|
-
assert @co.document_children
|
416
|
-
|
417
|
-
@co.stop_doc
|
418
|
-
|
419
|
-
assert @co.document_self
|
420
|
-
assert @co.document_children
|
421
|
-
end
|
422
|
-
|
423
|
-
def test_suppress
|
424
|
-
@co.suppress
|
425
|
-
|
426
|
-
refute @co.document_self
|
427
|
-
refute @co.document_children
|
428
|
-
assert @co.suppressed?
|
429
|
-
|
430
|
-
@store.rdoc.options.visibility = :nodoc
|
431
|
-
|
432
|
-
@co.store = @store
|
433
|
-
|
434
|
-
refute @co.suppressed?
|
435
|
-
|
436
|
-
@co.suppress
|
437
|
-
|
438
|
-
refute @co.suppressed?
|
439
|
-
end
|
440
|
-
|
441
|
-
def test_suppress_eh
|
442
|
-
refute @co.suppressed?
|
443
|
-
|
444
|
-
@co.suppress
|
445
|
-
|
446
|
-
assert @co.suppressed?
|
447
|
-
end
|
448
|
-
|
449
|
-
end
|
450
|
-
|
data/test/test_rdoc_comment.rb
DELETED
@@ -1,504 +0,0 @@
|
|
1
|
-
# coding: us-ascii
|
2
|
-
|
3
|
-
require 'rdoc/test_case'
|
4
|
-
|
5
|
-
class TestRDocComment < RDoc::TestCase
|
6
|
-
|
7
|
-
def setup
|
8
|
-
super
|
9
|
-
|
10
|
-
@top_level = @store.add_file 'file.rb'
|
11
|
-
@comment = RDoc::Comment.new
|
12
|
-
@comment.location = @top_level
|
13
|
-
@comment.text = 'this is a comment'
|
14
|
-
end
|
15
|
-
|
16
|
-
def test_empty_eh
|
17
|
-
refute_empty @comment
|
18
|
-
|
19
|
-
@comment = ''
|
20
|
-
|
21
|
-
assert_empty @comment
|
22
|
-
end
|
23
|
-
|
24
|
-
def test_equals2
|
25
|
-
assert_equal @comment, @comment.dup
|
26
|
-
|
27
|
-
c2 = @comment.dup
|
28
|
-
c2.text = nil
|
29
|
-
|
30
|
-
refute_equal @comment, c2
|
31
|
-
|
32
|
-
c3 = @comment.dup
|
33
|
-
c3.location = nil
|
34
|
-
|
35
|
-
refute_equal @comment, c3
|
36
|
-
end
|
37
|
-
|
38
|
-
def test_extract_call_seq
|
39
|
-
m = RDoc::AnyMethod.new nil, 'm'
|
40
|
-
|
41
|
-
comment = RDoc::Comment.new <<-COMMENT, @top_level
|
42
|
-
call-seq:
|
43
|
-
bla => true or false
|
44
|
-
|
45
|
-
moar comment
|
46
|
-
COMMENT
|
47
|
-
|
48
|
-
comment.extract_call_seq m
|
49
|
-
|
50
|
-
assert_equal "bla => true or false\n", m.call_seq
|
51
|
-
end
|
52
|
-
|
53
|
-
def test_extract_call_seq_blank
|
54
|
-
m = RDoc::AnyMethod.new nil, 'm'
|
55
|
-
|
56
|
-
comment = RDoc::Comment.new <<-COMMENT, @top_level
|
57
|
-
call-seq:
|
58
|
-
bla => true or false
|
59
|
-
|
60
|
-
COMMENT
|
61
|
-
|
62
|
-
comment.extract_call_seq m
|
63
|
-
|
64
|
-
assert_equal "bla => true or false\n", m.call_seq
|
65
|
-
end
|
66
|
-
|
67
|
-
def test_extract_call_seq_commented
|
68
|
-
m = RDoc::AnyMethod.new nil, 'm'
|
69
|
-
|
70
|
-
comment = RDoc::Comment.new <<-COMMENT, @top_level
|
71
|
-
# call-seq:
|
72
|
-
# bla => true or false
|
73
|
-
#
|
74
|
-
# moar comment
|
75
|
-
COMMENT
|
76
|
-
|
77
|
-
comment.extract_call_seq m
|
78
|
-
|
79
|
-
assert_equal nil, m.call_seq
|
80
|
-
end
|
81
|
-
|
82
|
-
def test_extract_call_seq_no_blank
|
83
|
-
m = RDoc::AnyMethod.new nil, 'm'
|
84
|
-
|
85
|
-
comment = RDoc::Comment.new <<-COMMENT, @top_level
|
86
|
-
call-seq:
|
87
|
-
bla => true or false
|
88
|
-
COMMENT
|
89
|
-
|
90
|
-
comment.extract_call_seq m
|
91
|
-
|
92
|
-
assert_equal "bla => true or false\n", m.call_seq
|
93
|
-
end
|
94
|
-
|
95
|
-
def test_extract_call_seq_undent
|
96
|
-
m = RDoc::AnyMethod.new nil, 'm'
|
97
|
-
|
98
|
-
comment = RDoc::Comment.new <<-COMMENT, @top_level
|
99
|
-
call-seq:
|
100
|
-
bla => true or false
|
101
|
-
moar comment
|
102
|
-
COMMENT
|
103
|
-
|
104
|
-
comment.extract_call_seq m
|
105
|
-
|
106
|
-
assert_equal "bla => true or false\nmoar comment\n", m.call_seq
|
107
|
-
end
|
108
|
-
|
109
|
-
def test_extract_call_seq_c
|
110
|
-
comment = RDoc::Comment.new <<-COMMENT
|
111
|
-
call-seq:
|
112
|
-
commercial() -> Date <br />
|
113
|
-
commercial(cwyear, cweek=41, cwday=5, sg=nil) -> Date [ruby 1.8] <br />
|
114
|
-
commercial(cwyear, cweek=1, cwday=1, sg=nil) -> Date [ruby 1.9]
|
115
|
-
|
116
|
-
If no arguments are given:
|
117
|
-
* ruby 1.8: returns a +Date+ for 1582-10-15 (the Day of Calendar Reform in
|
118
|
-
Italy)
|
119
|
-
* ruby 1.9: returns a +Date+ for julian day 0
|
120
|
-
|
121
|
-
Otherwise, returns a +Date+ for the commercial week year, commercial week,
|
122
|
-
and commercial week day given. Ignores the 4th argument.
|
123
|
-
COMMENT
|
124
|
-
|
125
|
-
method_obj = RDoc::AnyMethod.new nil, 'blah'
|
126
|
-
|
127
|
-
comment.extract_call_seq method_obj
|
128
|
-
|
129
|
-
expected = <<-CALL_SEQ.chomp
|
130
|
-
commercial() -> Date <br />
|
131
|
-
commercial(cwyear, cweek=41, cwday=5, sg=nil) -> Date [ruby 1.8] <br />
|
132
|
-
commercial(cwyear, cweek=1, cwday=1, sg=nil) -> Date [ruby 1.9]
|
133
|
-
|
134
|
-
CALL_SEQ
|
135
|
-
|
136
|
-
assert_equal expected, method_obj.call_seq
|
137
|
-
end
|
138
|
-
|
139
|
-
def test_extract_call_seq_c_no_blank
|
140
|
-
comment = RDoc::Comment.new <<-COMMENT
|
141
|
-
call-seq:
|
142
|
-
commercial() -> Date <br />
|
143
|
-
commercial(cwyear, cweek=41, cwday=5, sg=nil) -> Date [ruby 1.8] <br />
|
144
|
-
commercial(cwyear, cweek=1, cwday=1, sg=nil) -> Date [ruby 1.9]
|
145
|
-
COMMENT
|
146
|
-
|
147
|
-
method_obj = RDoc::AnyMethod.new nil, 'blah'
|
148
|
-
|
149
|
-
comment.extract_call_seq method_obj
|
150
|
-
|
151
|
-
expected = <<-CALL_SEQ.chomp
|
152
|
-
commercial() -> Date <br />
|
153
|
-
commercial(cwyear, cweek=41, cwday=5, sg=nil) -> Date [ruby 1.8] <br />
|
154
|
-
commercial(cwyear, cweek=1, cwday=1, sg=nil) -> Date [ruby 1.9]
|
155
|
-
|
156
|
-
CALL_SEQ
|
157
|
-
|
158
|
-
assert_equal expected, method_obj.call_seq
|
159
|
-
end
|
160
|
-
|
161
|
-
def test_extract_call_seq_c_separator
|
162
|
-
comment = RDoc::Comment.new <<-'COMMENT'
|
163
|
-
call-seq:
|
164
|
-
ARGF.readlines(sep=$/) -> array
|
165
|
-
ARGF.readlines(limit) -> array
|
166
|
-
ARGF.readlines(sep, limit) -> array
|
167
|
-
|
168
|
-
ARGF.to_a(sep=$/) -> array
|
169
|
-
ARGF.to_a(limit) -> array
|
170
|
-
ARGF.to_a(sep, limit) -> array
|
171
|
-
|
172
|
-
Reads +ARGF+'s current file in its entirety, returning an +Array+ of its
|
173
|
-
lines, one line per element. Lines are assumed to be separated by _sep_.
|
174
|
-
|
175
|
-
lines = ARGF.readlines
|
176
|
-
lines[0] #=> "This is line one\n"
|
177
|
-
|
178
|
-
COMMENT
|
179
|
-
|
180
|
-
method_obj = RDoc::AnyMethod.new nil, 'blah'
|
181
|
-
|
182
|
-
comment.extract_call_seq method_obj
|
183
|
-
|
184
|
-
expected = <<-CALL_SEQ
|
185
|
-
ARGF.readlines(sep=$/) -> array
|
186
|
-
ARGF.readlines(limit) -> array
|
187
|
-
ARGF.readlines(sep, limit) -> array
|
188
|
-
ARGF.to_a(sep=$/) -> array
|
189
|
-
ARGF.to_a(limit) -> array
|
190
|
-
ARGF.to_a(sep, limit) -> array
|
191
|
-
CALL_SEQ
|
192
|
-
|
193
|
-
assert_equal expected, method_obj.call_seq
|
194
|
-
|
195
|
-
expected = <<-'COMMENT'
|
196
|
-
|
197
|
-
Reads +ARGF+'s current file in its entirety, returning an +Array+ of its
|
198
|
-
lines, one line per element. Lines are assumed to be separated by _sep_.
|
199
|
-
|
200
|
-
lines = ARGF.readlines
|
201
|
-
lines[0] #=> "This is line one\n"
|
202
|
-
|
203
|
-
COMMENT
|
204
|
-
|
205
|
-
assert_equal expected, comment.text
|
206
|
-
end
|
207
|
-
|
208
|
-
def test_force_encoding
|
209
|
-
skip "Encoding not implemented" unless Object.const_defined? :Encoding
|
210
|
-
|
211
|
-
@comment.force_encoding Encoding::UTF_8
|
212
|
-
|
213
|
-
assert_equal Encoding::UTF_8, @comment.text.encoding
|
214
|
-
end
|
215
|
-
|
216
|
-
def test_format
|
217
|
-
assert_equal 'rdoc', @comment.format
|
218
|
-
end
|
219
|
-
|
220
|
-
def test_format_equals
|
221
|
-
c = comment 'content'
|
222
|
-
document = c.parse
|
223
|
-
|
224
|
-
c.format = RDoc::RD
|
225
|
-
|
226
|
-
assert_equal RDoc::RD, c.format
|
227
|
-
refute_same document, c.parse
|
228
|
-
end
|
229
|
-
|
230
|
-
def test_initialize_copy
|
231
|
-
copy = @comment.dup
|
232
|
-
|
233
|
-
refute_same @comment.text, copy.text
|
234
|
-
assert_same @comment.location, copy.location
|
235
|
-
end
|
236
|
-
|
237
|
-
def test_location
|
238
|
-
assert_equal @top_level, @comment.location
|
239
|
-
end
|
240
|
-
|
241
|
-
def test_normalize
|
242
|
-
@comment.text = <<-TEXT
|
243
|
-
# comment
|
244
|
-
TEXT
|
245
|
-
|
246
|
-
assert_same @comment, @comment.normalize
|
247
|
-
|
248
|
-
assert_equal 'comment', @comment.text
|
249
|
-
end
|
250
|
-
|
251
|
-
def test_normalize_twice
|
252
|
-
@comment.text = <<-TEXT
|
253
|
-
# comment
|
254
|
-
TEXT
|
255
|
-
|
256
|
-
@comment.normalize
|
257
|
-
|
258
|
-
text = @comment.text
|
259
|
-
|
260
|
-
@comment.normalize
|
261
|
-
|
262
|
-
assert_same text, @comment.text, 'normalize not cached'
|
263
|
-
end
|
264
|
-
|
265
|
-
def test_normalize_document
|
266
|
-
@comment.text = nil
|
267
|
-
@comment.document = @RM::Document.new
|
268
|
-
|
269
|
-
assert_same @comment, @comment.normalize
|
270
|
-
|
271
|
-
assert_nil @comment.text
|
272
|
-
end
|
273
|
-
|
274
|
-
def test_normalize_eh
|
275
|
-
refute @comment.normalized?
|
276
|
-
|
277
|
-
@comment.normalize
|
278
|
-
|
279
|
-
assert @comment.normalized?
|
280
|
-
end
|
281
|
-
|
282
|
-
def test_text
|
283
|
-
assert_equal 'this is a comment', @comment.text
|
284
|
-
end
|
285
|
-
|
286
|
-
def test_text_equals
|
287
|
-
@comment.text = 'other'
|
288
|
-
|
289
|
-
assert_equal 'other', @comment.text
|
290
|
-
refute @comment.normalized?
|
291
|
-
end
|
292
|
-
|
293
|
-
def test_text_equals_no_text
|
294
|
-
c = RDoc::Comment.new nil, @top_level
|
295
|
-
c.document = @RM::Document.new
|
296
|
-
|
297
|
-
e = assert_raises RDoc::Error do
|
298
|
-
c.text = 'other'
|
299
|
-
end
|
300
|
-
|
301
|
-
assert_equal 'replacing document-only comment is not allowed', e.message
|
302
|
-
end
|
303
|
-
|
304
|
-
def test_text_equals_parsed
|
305
|
-
document = @comment.parse
|
306
|
-
|
307
|
-
@comment.text = 'other'
|
308
|
-
|
309
|
-
refute_equal document, @comment.parse
|
310
|
-
end
|
311
|
-
|
312
|
-
def test_tomdoc_eh
|
313
|
-
refute @comment.tomdoc?
|
314
|
-
|
315
|
-
@comment.format = 'tomdoc'
|
316
|
-
|
317
|
-
assert @comment.tomdoc?
|
318
|
-
end
|
319
|
-
|
320
|
-
def test_parse
|
321
|
-
parsed = @comment.parse
|
322
|
-
|
323
|
-
expected = @RM::Document.new(
|
324
|
-
@RM::Paragraph.new('this is a comment'))
|
325
|
-
|
326
|
-
expected.file = @top_level
|
327
|
-
|
328
|
-
assert_equal expected, parsed
|
329
|
-
assert_same parsed, @comment.parse
|
330
|
-
end
|
331
|
-
|
332
|
-
def test_parse_rd
|
333
|
-
c = comment 'it ((*works*))'
|
334
|
-
c.format = 'rd'
|
335
|
-
|
336
|
-
expected =
|
337
|
-
@RM::Document.new(
|
338
|
-
@RM::Paragraph.new('it <em>works</em>'))
|
339
|
-
expected.file = @top_level
|
340
|
-
|
341
|
-
assert_equal expected, c.parse
|
342
|
-
end
|
343
|
-
|
344
|
-
def test_remove_private_encoding
|
345
|
-
skip "Encoding not implemented" unless Object.const_defined? :Encoding
|
346
|
-
|
347
|
-
comment = RDoc::Comment.new <<-EOS, @top_level
|
348
|
-
# This is text
|
349
|
-
#--
|
350
|
-
# this is private
|
351
|
-
EOS
|
352
|
-
|
353
|
-
comment.force_encoding Encoding::IBM437
|
354
|
-
|
355
|
-
comment.remove_private
|
356
|
-
|
357
|
-
assert_equal Encoding::IBM437, comment.text.encoding
|
358
|
-
end
|
359
|
-
|
360
|
-
def test_remove_private_hash
|
361
|
-
@comment.text = <<-TEXT
|
362
|
-
#--
|
363
|
-
# private
|
364
|
-
#++
|
365
|
-
# public
|
366
|
-
TEXT
|
367
|
-
|
368
|
-
@comment.remove_private
|
369
|
-
|
370
|
-
assert_equal "# public\n", @comment.text
|
371
|
-
end
|
372
|
-
|
373
|
-
def test_remove_private_hash_trail
|
374
|
-
comment = RDoc::Comment.new <<-EOS, @top_level
|
375
|
-
# This is text
|
376
|
-
#--
|
377
|
-
# this is private
|
378
|
-
EOS
|
379
|
-
|
380
|
-
expected = RDoc::Comment.new <<-EOS, @top_level
|
381
|
-
# This is text
|
382
|
-
EOS
|
383
|
-
|
384
|
-
comment.remove_private
|
385
|
-
|
386
|
-
assert_equal expected, comment
|
387
|
-
end
|
388
|
-
|
389
|
-
def test_remove_private_long
|
390
|
-
comment = RDoc::Comment.new <<-EOS, @top_level
|
391
|
-
#-----
|
392
|
-
#++
|
393
|
-
# this is text
|
394
|
-
#-----
|
395
|
-
EOS
|
396
|
-
|
397
|
-
expected = RDoc::Comment.new <<-EOS, @top_level
|
398
|
-
# this is text
|
399
|
-
EOS
|
400
|
-
|
401
|
-
comment.remove_private
|
402
|
-
|
403
|
-
assert_equal expected, comment
|
404
|
-
end
|
405
|
-
|
406
|
-
def test_remove_private_rule
|
407
|
-
comment = RDoc::Comment.new <<-EOS, @top_level
|
408
|
-
# This is text with a rule:
|
409
|
-
# ---
|
410
|
-
# this is also text
|
411
|
-
EOS
|
412
|
-
|
413
|
-
expected = comment.dup
|
414
|
-
|
415
|
-
comment.remove_private
|
416
|
-
|
417
|
-
assert_equal expected, comment
|
418
|
-
end
|
419
|
-
|
420
|
-
def test_remove_private_star
|
421
|
-
@comment.text = <<-TEXT
|
422
|
-
/*
|
423
|
-
*--
|
424
|
-
* private
|
425
|
-
*++
|
426
|
-
* public
|
427
|
-
*/
|
428
|
-
TEXT
|
429
|
-
|
430
|
-
@comment.remove_private
|
431
|
-
|
432
|
-
assert_equal "/*\n * public\n */\n", @comment.text
|
433
|
-
end
|
434
|
-
|
435
|
-
def test_remove_private_star2
|
436
|
-
@comment.text = <<-TEXT
|
437
|
-
/*--
|
438
|
-
* private
|
439
|
-
*++
|
440
|
-
* public
|
441
|
-
*/
|
442
|
-
TEXT
|
443
|
-
|
444
|
-
@comment.remove_private
|
445
|
-
|
446
|
-
assert_equal "/*--\n * private\n *++\n * public\n */\n", @comment.text
|
447
|
-
end
|
448
|
-
|
449
|
-
def test_remove_private_toggle
|
450
|
-
comment = RDoc::Comment.new <<-EOS, @top_level
|
451
|
-
# This is text
|
452
|
-
#--
|
453
|
-
# this is private
|
454
|
-
#++
|
455
|
-
# This is text again.
|
456
|
-
EOS
|
457
|
-
|
458
|
-
expected = RDoc::Comment.new <<-EOS, @top_level
|
459
|
-
# This is text
|
460
|
-
# This is text again.
|
461
|
-
EOS
|
462
|
-
|
463
|
-
comment.remove_private
|
464
|
-
|
465
|
-
assert_equal expected, comment
|
466
|
-
end
|
467
|
-
|
468
|
-
def test_remove_private_toggle_encoding
|
469
|
-
skip "Encoding not implemented" unless Object.const_defined? :Encoding
|
470
|
-
|
471
|
-
comment = RDoc::Comment.new <<-EOS, @top_level
|
472
|
-
# This is text
|
473
|
-
#--
|
474
|
-
# this is private
|
475
|
-
#++
|
476
|
-
# This is text again.
|
477
|
-
EOS
|
478
|
-
|
479
|
-
comment.force_encoding Encoding::IBM437
|
480
|
-
|
481
|
-
comment.remove_private
|
482
|
-
|
483
|
-
assert_equal Encoding::IBM437, comment.text.encoding
|
484
|
-
end
|
485
|
-
|
486
|
-
def test_remove_private_toggle_encoding_ruby_bug?
|
487
|
-
skip "Encoding not implemented" unless Object.const_defined? :Encoding
|
488
|
-
|
489
|
-
comment = RDoc::Comment.new <<-EOS, @top_level
|
490
|
-
#--
|
491
|
-
# this is private
|
492
|
-
#++
|
493
|
-
# This is text again.
|
494
|
-
EOS
|
495
|
-
|
496
|
-
comment.force_encoding Encoding::IBM437
|
497
|
-
|
498
|
-
comment.remove_private
|
499
|
-
|
500
|
-
assert_equal Encoding::IBM437, comment.text.encoding
|
501
|
-
end
|
502
|
-
|
503
|
-
end
|
504
|
-
|