From a5b6baae97a31f24483b2b59744799852bacc7d1 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Wed, 24 Mar 2021 15:26:49 +0900 Subject: Fix test-bundler failures when XDG_CONFIG_HOME is not writable https://github.com/ruby/actions/runs/2175399707?check_suite_focus=true ``` Errno::EACCES: Permission denied @ dir_s_mkdir - /home/runner/.config/irb ``` --- spec/bundler/support/path.rb | 4 ++++ spec/bundler/support/rubygems_ext.rb | 1 + 2 files changed, 5 insertions(+) (limited to 'spec') diff --git a/spec/bundler/support/path.rb b/spec/bundler/support/path.rb index 56d3c71f3c..62f136aa0b 100644 --- a/spec/bundler/support/path.rb +++ b/spec/bundler/support/path.rb @@ -193,6 +193,10 @@ module Spec root.join("lib") end + def xdg_config_home + home(".config") + end + def global_plugin_gem(*args) home ".bundle", "plugin", "gems", *args end diff --git a/spec/bundler/support/rubygems_ext.rb b/spec/bundler/support/rubygems_ext.rb index 55f20ff29a..59429884d6 100644 --- a/spec/bundler/support/rubygems_ext.rb +++ b/spec/bundler/support/rubygems_ext.rb @@ -33,6 +33,7 @@ module Spec ENV["HOME"] = Path.home.to_s ENV["TMPDIR"] = Path.tmpdir.to_s + ENV["XDG_CONFIG_HOME"] = Path.xdg_config_home.to_s require "rubygems/user_interaction" Gem::DefaultUserInteraction.ui = Gem::SilentUI.new -- cgit v1.2.3