summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 83a3c44..79bd3e2 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)