Skip to content

Commit

Permalink
Fix the failing test with XDG_CONFIG_HOME
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Jan 12, 2021
1 parent 7dc0511 commit 0dc9526
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/irb/test_init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def test_setup_with_minimum_argv_does_not_change_dollar0

def test_rc_file
backup_irbrc = ENV.delete("IRBRC") # This is for RVM...
backup_xdg_config_home = ENV.delete("XDG_CONFIG_HOME")
backup_home = ENV["HOME"]
Dir.mktmpdir("test_irb_init_#{$$}") do |tmpdir|
ENV["HOME"] = tmpdir
Expand All @@ -35,11 +36,13 @@ def test_rc_file
end
ensure
ENV["HOME"] = backup_home
ENV["XDG_CONFIG_HOME"] = backup_xdg_config_home
ENV["IRBRC"] = backup_irbrc
end

def test_rc_file_in_subdir
backup_irbrc = ENV.delete("IRBRC") # This is for RVM...
backup_xdg_config_home = ENV.delete("XDG_CONFIG_HOME")
backup_home = ENV["HOME"]
Dir.mktmpdir("test_irb_init_#{$$}") do |tmpdir|
ENV["HOME"] = tmpdir
Expand All @@ -57,6 +60,7 @@ def test_rc_file_in_subdir
end
ensure
ENV["HOME"] = backup_home
ENV["XDG_CONFIG_HOME"] = backup_xdg_config_home
ENV["IRBRC"] = backup_irbrc
end

Expand Down

0 comments on commit 0dc9526

Please sign in to comment.