Skip to content

Commit 6358ecb

Browse files
committed
fix: handle cross-platform PATH separator in tests
Replace hardcoded ':' with File::PATH_SEPARATOR when constructing PATH in gem installation test so executables are located on Windows systems.
1 parent a37452f commit 6358ecb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/gem_installation.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ def run_gem_installation_test(gem_bin, gem_module)
2222
gem_file = gem_build.lines.grep(/File:/).first.split.last
2323
gem_file = File.expand_path(File.join(gem_dir, gem_file))
2424

25-
env = { 'GEM_HOME' => gem_home, 'GEM_PATH' => gem_home, 'PATH' => "#{gem_home}/bin:#{ENV['PATH']}" }
25+
path_separator = File::PATH_SEPARATOR
26+
env = {
27+
'GEM_HOME' => gem_home,
28+
'GEM_PATH' => gem_home,
29+
'PATH' => "#{gem_home}/bin#{path_separator}#{ENV['PATH']}"
30+
}
2631
system(env, 'gem', 'install', '--local', gem_file, exception: true)
2732

2833
out_dir = File.join('test', 'tmp', "gem_install_#{gem_bin.tr('-', '_')}")

0 commit comments

Comments
 (0)