[前][次][番号順一覧][スレッド一覧]

ruby-changes:66571

From: Nobuyoshi <ko1@a...>
Date: Wed, 23 Jun 2021 14:25:32 +0900 (JST)
Subject: [ruby-changes:66571] 950c7a12ef (master): Make temporary directory under the regular location

https://git.ruby-lang.org/ruby.git/commit/?id=950c7a12ef

From 950c7a12efa19d73bed10d377368a50664cae32c Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 23 Jun 2021 14:15:54 +0900
Subject: 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 4f88391..e30695a 100644
--- a/test/rdoc/test_rdoc_rubygems_hook.rb
+++ b/test/rdoc/test_rdoc_rubygems_hook.rb
@@ -7,8 +7,6 @@ require "test/unit" https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_rubygems_hook.rb#L7
 
 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 https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_rubygems_hook.rb#L14
       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 https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_rubygems_hook.rb#L39
   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
 
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]