summaryrefslogtreecommitdiff
path: root/spec/bundler/commands/console_spec.rb
diff options
context:
space:
mode:
authorKazuhiro NISHIYAMA <zn@mbf.nifty.com>2021-04-17 11:54:10 +0900
committerKazuhiro NISHIYAMA <zn@mbf.nifty.com>2021-04-17 11:54:10 +0900
commitd953ac11394729ef66a4fb44f2eb1383b0ef2e00 (patch)
tree60209120aa807266b0df17171c408d709a8c165a /spec/bundler/commands/console_spec.rb
parentb6bb4623ebcf1335cf0a81d279cde24a9e97bcce (diff)
Fix writing XDG_CONFIG_HOME in test-bundler
https://github.com/ruby/actions/actions/runs/756591173 ``` Errno::EACCES: Permission denied @ dir_s_mkdir - /home/runner/.config/irb ```
Diffstat (limited to 'spec/bundler/commands/console_spec.rb')
-rw-r--r--spec/bundler/commands/console_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/bundler/commands/console_spec.rb b/spec/bundler/commands/console_spec.rb
index aa76096e3d..1a38ce29d5 100644
--- a/spec/bundler/commands/console_spec.rb
+++ b/spec/bundler/commands/console_spec.rb
@@ -45,6 +45,17 @@ RSpec.describe "bundle console", :bundler => "< 3", :readline => true do
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")