summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-15 14:40:07 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-15 14:40:07 +0000
commitf033cfa3816e0138906aeaf8adcd3c18a623d16a (patch)
tree008c124bfab93b99a25826f7298d8f3c89ff0525 /lib
parent52c738408e7624d1f6ebb8c62a7497fed2684bf5 (diff)
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
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems/test_case.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb
index 4e48f1eb4c..fee6875ef0 100644
--- a/lib/rubygems/test_case.rb
+++ b/lib/rubygems/test_case.rb
@@ -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