summaryrefslogtreecommitdiff
path: root/lib/rubygems/test_case.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2020-04-29 14:18:59 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-05-08 14:13:29 +0900
commit93293043f135dec5a972378682b9e947fba7c4a6 (patch)
tree0b29babfec3cae2b071dc55d6b496a772249cffd /lib/rubygems/test_case.rb
parentb9031b10431b4ca517b520ddb9f86d82f16a3372 (diff)
[rubygems/rubygems] Remove unneeded global teardown
Instead, make each test cleanup after itself. https://github.com/rubygems/rubygems/commit/e0aba9d64f
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3092
Diffstat (limited to 'lib/rubygems/test_case.rb')
-rw-r--r--lib/rubygems/test_case.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb
index 0609519efa..e2a880ef2b 100644
--- a/lib/rubygems/test_case.rb
+++ b/lib/rubygems/test_case.rb
@@ -357,12 +357,7 @@ class Gem::TestCase < Minitest::Test
Dir.chdir @tempdir
ENV['HOME'] = @userhome
- FileUtils.mkdir_p File.join(@userhome, ".gem")
- File.write File.join(@userhome, ".gemrc"), "--- {}"
-
Gem.instance_variable_set :@user_home, nil
- Gem.instance_variable_set :@cache_home, nil
- Gem.instance_variable_set :@data_home, nil
Gem.instance_variable_set :@gemdeps, nil
Gem.instance_variable_set :@env_requirements_by_name, nil
Gem.send :remove_instance_variable, :@ruby_version if
@@ -482,6 +477,10 @@ class Gem::TestCase < Minitest::Test
File.chmod 0600, @temp_cred
end
+ def credential_teardown
+ FileUtils.rm_rf @temp_cred
+ end
+
def common_installer_setup
common_installer_teardown