diff options
author | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2021-03-18 15:20:41 +0900 |
---|---|---|
committer | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2021-03-18 15:20:41 +0900 |
commit | e0dd072978e6c2c8180e75617e7ee37830caefa3 (patch) | |
tree | 3f24d936d00eeb8302807b61b2a2395154d3bc99 /test | |
parent | 05ebaee80e97710e895527b74908112a1d77348c (diff) |
Fix errors when XDG_CONFIG_HOME points to non-writable directory
`$HOME/.config` is not writable on CI
because I think tests should not corrupt user's data.
And GitHub Actions CI sets `XDG_CONFIG_HOME`
since `Version: 20210309.1`.
https://github.com/ruby/actions/runs/2130811016?check_suite_focus=true#step:16:301
```
Errno::EACCES: Permission denied @ dir_s_mkdir - /home/runner/.config/irb
```
Diffstat (limited to 'test')
-rw-r--r-- | test/irb/test_cmd.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/irb/test_cmd.rb b/test/irb/test_cmd.rb index 41f84f1922..16f5940338 100644 --- a/test/irb/test_cmd.rb +++ b/test/irb/test_cmd.rb @@ -17,12 +17,14 @@ module TestIRB Dir.chdir(@tmpdir) @home_backup = ENV["HOME"] ENV["HOME"] = @tmpdir + @xdg_config_home_backup = ENV.delete("XDG_CONFIG_HOME") @default_encoding = [Encoding.default_external, Encoding.default_internal] @stdio_encodings = [STDIN, STDOUT, STDERR].map {|io| [io.external_encoding, io.internal_encoding] } IRB.instance_variable_get(:@CONF).clear end def teardown + ENV["XDG_CONFIG_HOME"] = @xdg_config_home_backup ENV["HOME"] = @home_backup Dir.chdir(@pwd) FileUtils.rm_rf(@tmpdir) |