Skip to content

Commit 69a029c

Browse files
committed
Fallback HOME
1 parent 63b28cc commit 69a029c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/optparse/test_load.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def assert_load_nothing
3737
end
3838

3939
def setup_options(env, dir, suffix = nil)
40+
env.update({'HOME'=>@tmpdir})
4041
optdir = File.join(@tmpdir, dir)
4142
FileUtils.mkdir_p(optdir)
4243
file = File.join(optdir, [@basename, suffix].join(""))
@@ -75,7 +76,6 @@ def setup_options_home_config_settings(&block)
7576
end
7677

7778
def setup_options_home_options(envs, &block)
78-
envs.update({'HOME'=>@tmpdir})
7979
setup_options(envs, "options", ".options", &block)
8080
end
8181

@@ -145,7 +145,9 @@ def test_load_home_config_settings
145145
end
146146

147147
def test_load_nothing
148-
assert_load_nothing
148+
setup_options({'HOME'=>'/'}, "") do
149+
assert_load_nothing
150+
end
149151
end
150152

151153
def test_not_expand_path_basename

0 commit comments

Comments
 (0)