From 4021c6565f9655bfd667152f76f22f7cc81c7e17 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 31 Mar 2022 12:51:04 +0900 Subject: [ruby/irb] Do not make non-existent XDG directory on start (https://github.com/ruby/irb/pull/357) https://github.com/ruby/irb/commit/298b134792 --- test/irb/test_init.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test') diff --git a/test/irb/test_init.rb b/test/irb/test_init.rb index 074aae4070..39c5cfa8a0 100644 --- a/test/irb/test_init.rb +++ b/test/irb/test_init.rb @@ -36,13 +36,16 @@ module TestIRB def test_rc_file tmpdir = @tmpdir Dir.chdir(tmpdir) do + ENV["XDG_CONFIG_HOME"] = "#{tmpdir}/xdg" IRB.conf[:RC_NAME_GENERATOR] = nil assert_equal(tmpdir+"/.irb#{IRB::IRBRC_EXT}", IRB.rc_file) assert_equal(tmpdir+"/.irb_history", IRB.rc_file("_history")) + assert_file.not_exist?(tmpdir+"/xdg") IRB.conf[:RC_NAME_GENERATOR] = nil FileUtils.touch(tmpdir+"/.irb#{IRB::IRBRC_EXT}") assert_equal(tmpdir+"/.irb#{IRB::IRBRC_EXT}", IRB.rc_file) assert_equal(tmpdir+"/.irb_history", IRB.rc_file("_history")) + assert_file.not_exist?(tmpdir+"/xdg") end end -- cgit v1.2.3