mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
refresh Gem at the end of teardown
.
* lib/rubygems/test_case.rb (teardown): call `Gem::refresh()` at the end of `teardown`. On parallel test sometimes fails test process. The reason is: (1) previous tests remains `Gem::Specification@@stubs` value which points to temporary directories and the directories are removed by `teardown` method of previous test. (2) `require 'rubygems/gem_runner'` in `test_gem_gem_runner.rb` tries to require test utility file. However, with strange `@@stubs` RubyGems tries to load specification from removed directory. `StubSpecification#to_spec` returns `nil` and error will occur. The solution this patch employs is to refresh all of parameters includes `Gem::Specification@@stubs` by `Gem::refresh()`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
52c738408e
commit
f033cfa381
1 changed files with 1 additions and 0 deletions
|
@ -410,6 +410,7 @@ class Gem::TestCase < MiniTest::Unit::TestCase
|
|||
|
||||
Gem::Specification._clear_load_cache
|
||||
Gem::Specification.unresolved_deps.clear
|
||||
Gem::refresh
|
||||
end
|
||||
|
||||
def common_installer_setup
|
||||
|
|
Loading…
Reference in a new issue