@@ -181,6 +181,60 @@ def test_normalized_file_list_non_file_directory
181181 assert_match %r"#{ dev } $" , err
182182 end
183183
184+ def test_normalized_file_list_with_dot_doc
185+ expected_files = [ ]
186+ files = temp_dir do |dir |
187+ a = File . expand_path ( 'a.rb' )
188+ b = File . expand_path ( 'b.rb' )
189+ c = File . expand_path ( 'c.rb' )
190+ FileUtils . touch a
191+ FileUtils . touch b
192+ FileUtils . touch c
193+
194+ dot_doc = File . expand_path ( '.document' )
195+ FileUtils . touch dot_doc
196+ open ( dot_doc , 'w' ) do |f |
197+ f . puts 'a.rb'
198+ f . puts 'b.rb'
199+ end
200+ expected_files << a
201+ expected_files << b
202+
203+ @rdoc . normalized_file_list [ dir ]
204+ end
205+
206+ files = files . map { |file | File . expand_path file }
207+
208+ assert_equal expected_files , files
209+ end
210+
211+ def test_normalized_file_list_with_dot_doc_overridden_by_exclude_option
212+ expected_files = [ ]
213+ files = temp_dir do |dir |
214+ a = File . expand_path ( 'a.rb' )
215+ b = File . expand_path ( 'b.rb' )
216+ c = File . expand_path ( 'c.rb' )
217+ FileUtils . touch a
218+ FileUtils . touch b
219+ FileUtils . touch c
220+
221+ dot_doc = File . expand_path ( '.document' )
222+ FileUtils . touch dot_doc
223+ open ( dot_doc , 'w' ) do |f |
224+ f . puts 'a.rb'
225+ f . puts 'b.rb'
226+ end
227+ expected_files << a
228+
229+ @rdoc . options . exclude = Regexp . new ( [ 'b.rb' ] . join ( '|' ) )
230+ @rdoc . normalized_file_list [ dir ]
231+ end
232+
233+ files = files . map { |file | File . expand_path file }
234+
235+ assert_equal expected_files , files
236+ end
237+
184238 def test_parse_file
185239 @rdoc . store = RDoc ::Store . new
186240
0 commit comments