summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-24 23:33:52 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-25 12:51:18 +0900
commitfd6d5c803a78e389a643c65ae8ac3761817c4341 (patch)
tree600a7ed79a0124a9e8814bc6ab61627cedd7a6a2 /lib
parent30f11e73c43672833b301ef89eca25d430e2480f (diff)
Clear each test own temporary directories
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4117
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems/test_case.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb
index 83a3c446a7..79bd3e2a60 100644
--- a/lib/rubygems/test_case.rb
+++ b/lib/rubygems/test_case.rb
@@ -301,9 +301,7 @@ class Gem::TestCase < Minitest::Test
def setup
@orig_env = ENV.to_hash
- @tmp = File.expand_path("tmp")
-
- FileUtils.mkdir_p @tmp
+ @tmp = Dir.mktmpdir("tmp", Dir.pwd)
ENV['GEM_VENDOR'] = nil
ENV['GEMRC'] = nil
@@ -451,6 +449,7 @@ class Gem::TestCase < Minitest::Test
Dir.chdir @current_dir
FileUtils.rm_rf @tempdir
+ FileUtils.rm_rf @tmp
ENV.replace(@orig_env)