From 950c7a12efa19d73bed10d377368a50664cae32c Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 23 Jun 2021 14:15:54 +0900 Subject: [PATCH] Make temporary directory under the regular location --- test/rdoc/test_rdoc_rubygems_hook.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/rdoc/test_rdoc_rubygems_hook.rb b/test/rdoc/test_rdoc_rubygems_hook.rb index 4f88391ebf..e30695a70a 100644 --- a/test/rdoc/test_rdoc_rubygems_hook.rb +++ b/test/rdoc/test_rdoc_rubygems_hook.rb @@ -7,8 +7,6 @@ require "test/unit" class TestRDocRubygemsHook < Test::Unit::TestCase def setup - FileUtils.mkdir_p File.expand_path("tmp") - @a = Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = "a" @@ -16,7 +14,7 @@ class TestRDocRubygemsHook < Test::Unit::TestCase s.rdoc_options = %w[--main MyTitle] s.extra_rdoc_files = %w[README] end - @tempdir = Dir.mktmpdir("test_rubygems_", File.expand_path("tmp")) + @tempdir = File.realpath(Dir.mktmpdir("test_rubygems_hook_")) @a.instance_variable_set(:@doc_dir, File.join(@tempdir, "doc")) @a.instance_variable_set(:@gem_dir, File.join(@tempdir, "a-2")) @@ -41,7 +39,7 @@ class TestRDocRubygemsHook < Test::Unit::TestCase def teardown ui = Gem::DefaultUserInteraction.ui Gem::DefaultUserInteraction.ui = @old_ui - FileUtils.rm_rf File.expand_path("tmp") + FileUtils.rm_rf @tempdir ui.close end