1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
```
This commit is contained in:
Kazuhiro NISHIYAMA 2021-04-19 21:37:21 +09:00
parent 93420d34aa
commit 50f17241a3
No known key found for this signature in database
GPG key ID: 262ED8DBB4222F7A
2 changed files with 11 additions and 11 deletions

View file

@ -45,17 +45,6 @@ RSpec.describe "bundle console", :bundler => "< 3", :readline => true do
G G
end 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 it "starts IRB with the default group loaded" do
bundle "console" do |input, _, _| bundle "console" do |input, _, _|
input.puts("puts RACK") input.puts("puts RACK")

View file

@ -4,6 +4,7 @@ require "bundler/psyched_yaml"
require "bundler/vendored_fileutils" require "bundler/vendored_fileutils"
require "bundler/vendored_uri" require "bundler/vendored_uri"
require "digest" require "digest"
require "tmpdir"
if File.expand_path(__FILE__) =~ %r{([^\w/\.:\-])} if File.expand_path(__FILE__) =~ %r{([^\w/\.:\-])}
abort "The bundler specs cannot be run from a path that contains special characters (particularly #{$1.inspect})" 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|
end end
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 config.after :suite do
FileUtils.rm_r Spec::Path.pristine_system_gem_path FileUtils.rm_r Spec::Path.pristine_system_gem_path
end end