mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fix errors when RDoc::RI::Paths::HOMEDIR
is nil
https://rubyci.org/logs/rubyci.s3.amazonaws.com/scw-ad7f67/ruby-master/log/20200425T175405Z.fail.html.gz ``` 4) Error: TestRDocServlet#test_asset: NoMethodError: undefined method `replace' for nil:NilClass /home/chkbuild/build/20200425T175405Z/ruby/test/rdoc/test_rdoc_servlet.rb:48:in `setup' 5) Error: TestRDocServlet#test_asset: NoMethodError: undefined method `replace' for nil:NilClass /home/chkbuild/build/20200425T175405Z/ruby/test/rdoc/test_rdoc_servlet.rb:63:in `teardown' ``` ... ``` 74) Error: TestRDocServlet#test_store_for_site: NoMethodError: undefined method `replace' for nil:NilClass /home/chkbuild/build/20200425T175405Z/ruby/test/rdoc/test_rdoc_servlet.rb:48:in `setup' 75) Error: TestRDocServlet#test_store_for_site: NoMethodError: undefined method `replace' for nil:NilClass /home/chkbuild/build/20200425T175405Z/ruby/test/rdoc/test_rdoc_servlet.rb:63:in `teardown' ```
This commit is contained in:
parent
9fd3f2432e
commit
63fe3739dd
1 changed files with 4 additions and 2 deletions
|
@ -45,7 +45,8 @@ class TestRDocServlet < RDoc::TestCase
|
|||
@orig_base = RDoc::RI::Paths::BASE
|
||||
RDoc::RI::Paths::BASE.replace @base
|
||||
@orig_ri_path_homedir = RDoc::RI::Paths::HOMEDIR
|
||||
RDoc::RI::Paths::HOMEDIR.replace @home_dir
|
||||
RDoc::RI::Paths.send :remove_const, :HOMEDIR
|
||||
RDoc::RI::Paths.const_set :HOMEDIR, @home_dir
|
||||
|
||||
RDoc::RI::Paths.instance_variable_set \
|
||||
:@gemdirs, %w[/nonexistent/gems/example-1.0/ri]
|
||||
|
@ -60,7 +61,8 @@ class TestRDocServlet < RDoc::TestCase
|
|||
FileUtils.rm_rf @tempdir
|
||||
|
||||
RDoc::RI::Paths::BASE.replace @orig_base
|
||||
RDoc::RI::Paths::HOMEDIR.replace @orig_ri_path_homedir
|
||||
RDoc::RI::Paths.send :remove_const, :HOMEDIR
|
||||
RDoc::RI::Paths.const_set :HOMEDIR, @orig_ri_path_homedir
|
||||
RDoc::RI::Paths.instance_variable_set :@gemdirs, nil
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue