ruby-changes:65891
From: Kazuhiro <ko1@a...>
Date: Mon, 19 Apr 2021 21:41:07 +0900 (JST)
Subject: [ruby-changes:65891] 50f17241a3 (master): Try to fix other failures of writing XDG_CONFIG_HOME
https://git.ruby-lang.org/ruby.git/commit/?id=50f17241a3 From 50f17241a32d837403fae68dc1ed0f046506d3e8 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA <zn@m...> Date: Mon, 19 Apr 2021 21:37:21 +0900 Subject: Try to fix other failures of writing XDG_CONFIG_HOME https://github.com/ruby/actions/actions/runs/756591173 https://github.com/ruby/actions/actions/runs/759073690 https://github.com/ruby/actions/actions/runs/761341026 ``` Errno::EACCES: Permission denied @ dir_s_mkdir - /home/runner/.config/irb ``` --- spec/bundler/commands/console_spec.rb | 11 ----------- spec/bundler/spec_helper.rb | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/spec/bundler/commands/console_spec.rb b/spec/bundler/commands/console_spec.rb index 1a38ce2..aa76096 100644 --- a/spec/bundler/commands/console_spec.rb +++ b/spec/bundler/commands/console_spec.rb @@ -45,17 +45,6 @@ RSpec.describe "bundle console", :bundler => "< 3", :readline => true do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/console_spec.rb#L45 G end - around :each do |example| - require 'tmpdir' - Dir.mktmpdir("bundler_commands_console") do |dir| - xdg_config_home_backup = ENV.delete("XDG_CONFIG_HOME") - ENV["XDG_CONFIG_HOME"] = dir - example.run - ensure - ENV["XDG_CONFIG_HOME"] = xdg_config_home_backup - end - end - it "starts IRB with the default group loaded" do bundle "console" do |input, _, _| input.puts("puts RACK") diff --git a/spec/bundler/spec_helper.rb b/spec/bundler/spec_helper.rb index db1055c..99be2f4 100644 --- a/spec/bundler/spec_helper.rb +++ b/spec/bundler/spec_helper.rb @@ -4,6 +4,7 @@ require "bundler/psyched_yaml" https://github.com/ruby/ruby/blob/trunk/spec/bundler/spec_helper.rb#L4 require "bundler/vendored_fileutils" require "bundler/vendored_uri" require "digest" +require "tmpdir" if File.expand_path(__FILE__) =~ %r{([^\w/\.:\-])} abort "The bundler specs cannot be run from a path that contains special characters (particularly #{$1.inspect})" @@ -110,6 +111,16 @@ RSpec.configure do |config| https://github.com/ruby/ruby/blob/trunk/spec/bundler/spec_helper.rb#L111 end end + config.around :each do |example| + Dir.mktmpdir("bundler_commands_console") do |dir| + xdg_config_home_backup = ENV.delete("XDG_CONFIG_HOME") + ENV["XDG_CONFIG_HOME"] = dir + example.run + ensure + ENV["XDG_CONFIG_HOME"] = xdg_config_home_backup + end + end + config.after :suite do FileUtils.rm_r Spec::Path.pristine_system_gem_path end -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/