[前][次][番号順一覧][スレッド一覧]

ruby-changes:53769

From: mame <ko1@a...>
Date: Mon, 26 Nov 2018 14:46:06 +0900 (JST)
Subject: [ruby-changes:53769] mame:r65986 (trunk): test/rdoc/test_rdoc_rdoc.rb: add dummy finish

mame	2018-11-26 14:46:02 +0900 (Mon, 26 Nov 2018)

  New Revision: 65986

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65986

  Log:
    test/rdoc/test_rdoc_rdoc.rb: add dummy finish
    
    RDoc::Options#@exclude is initialized as an empty array.
    Then, #finish converts it to a regexp or nil and reassign it to @exclude.
    Some methods of RDoc assumes that #finish has been already called.
    So, this change forces to assign nil to @exclude.
    
    This type confusion was found during work for removal of `Object#=~`.
    [Feature #15231]

  Modified files:
    trunk/test/rdoc/test_rdoc_rdoc.rb
Index: test/rdoc/test_rdoc_rdoc.rb
===================================================================
--- test/rdoc/test_rdoc_rdoc.rb	(revision 65985)
+++ test/rdoc/test_rdoc_rdoc.rb	(revision 65986)
@@ -69,6 +69,13 @@ class TestRDocRDoc < RDoc::TestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_rdoc.rb#L69
   end
 
   def test_gather_files
+    # TODO: dummy finish
+    # RDoc::Options#@exclude is initialized as an empty array.
+    # Then, #finish converts it to a regexp or nil and reassign it to @exclude.
+    # RDoc#gather_files assumes that #finish has been already called.
+    # So, it forces to assign nil to @exclude.
+    @rdoc.options.exclude = nil
+
     a = File.expand_path __FILE__
     b = File.expand_path '../test_rdoc_text.rb', __FILE__
 
@@ -182,6 +189,13 @@ class TestRDocRDoc < RDoc::TestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_rdoc.rb#L189
   end
 
   def test_normalized_file_list_with_dot_doc
+    # TODO: dummy finish
+    # RDoc::Options#@exclude is initialized as an empty array.
+    # Then, #finish converts it to a regexp or nil and reassign it to @exclude.
+    # RDoc#normalized_file_list assumes that #finish has been already called.
+    # So, it forces to assign nil to @exclude.
+    @rdoc.options.exclude = nil
+
     expected_files = []
     files = temp_dir do |dir|
       a = File.expand_path('a.rb')

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]