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

ruby-changes:66572

From: Nobuyoshi <ko1@a...>
Date: Wed, 23 Jun 2021 15:16:04 +0900 (JST)
Subject: [ruby-changes:66572] 69ce9e4187 (master): Clear default configurations

https://git.ruby-lang.org/ruby.git/commit/?id=69ce9e4187

From 69ce9e4187589335124077029496ee293d4e9189 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 23 Jun 2021 15:14:21 +0900
Subject: Clear default configurations

Remove environment variables which can affect the default
configurations.
---
 test/rdoc/test_rdoc_rubygems_hook.rb | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/test/rdoc/test_rdoc_rubygems_hook.rb b/test/rdoc/test_rdoc_rubygems_hook.rb
index e30695a..cc597ce 100644
--- a/test/rdoc/test_rdoc_rubygems_hook.rb
+++ b/test/rdoc/test_rdoc_rubygems_hook.rb
@@ -16,6 +16,18 @@ class TestRDocRubygemsHook < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_rubygems_hook.rb#L16
     end
     @tempdir = File.realpath(Dir.mktmpdir("test_rubygems_hook_"))
 
+    @orig_envs = %w[
+      GEM_VENDOR
+      GEMRC
+      XDG_CACHE_HOME
+      XDG_CONFIG_HOME
+      XDG_DATA_HOME
+      SOURCE_DATE_EPOCH
+      BUNDLER_VERSION
+      HOME
+    ].map {|e| [e, ENV.delete(e)]}.to_h
+    ENV["HOME"] = @tempdir
+
     @a.instance_variable_set(:@doc_dir, File.join(@tempdir, "doc"))
     @a.instance_variable_set(:@gem_dir, File.join(@tempdir, "a-2"))
     @a.instance_variable_set(:@full_gem_path, File.join(@tempdir, "a-2"))
@@ -41,6 +53,7 @@ class TestRDocRubygemsHook < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_rubygems_hook.rb#L53
     Gem::DefaultUserInteraction.ui = @old_ui
     FileUtils.rm_rf @tempdir
     ui.close
+    ENV.update(@orig_envs)
   end
 
   def test_initialize
-- 
cgit v1.1


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

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