Skip to content

Commit

Permalink
Fix errors when RDoc::RI::Paths::HOMEDIR is nil
Browse files Browse the repository at this point in the history
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'
```
  • Loading branch information
znz committed Apr 26, 2020
1 parent 9fd3f24 commit 63fe373
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/rdoc/test_rdoc_servlet.rb
Expand Up @@ -45,7 +45,8 @@ def @req.path= path
@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]
Expand All @@ -60,7 +61,8 @@ def teardown
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

Expand Down

0 comments on commit 63fe373

Please sign in to comment.