Skip to content

Commit b353d9b

Browse files
committed
test(gemset): Make tests path-separator agnostic
1 parent 74b9834 commit b353d9b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/gemset.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,12 @@ mod tests {
426426
Box::new(MockCommandExecutor::new()),
427427
);
428428
let path = gemset.gem_bin_path("ruby-lsp").unwrap();
429-
assert_eq!(path, "/test/gem_home/bin/ruby-lsp");
429+
let expected = Path::new(TEST_GEM_HOME)
430+
.join("bin")
431+
.join("ruby-lsp")
432+
.to_string_lossy()
433+
.into_owned();
434+
assert_eq!(path, expected);
430435
}
431436

432437
#[test]
@@ -438,12 +443,15 @@ mod tests {
438443
);
439444
let env: std::collections::HashMap<String, String> = gemset.env().iter().cloned().collect();
440445

446+
let gem_home = Path::new(TEST_GEM_HOME).display().to_string();
447+
let gem_bin = Path::new(TEST_GEM_HOME).join("bin").display().to_string();
448+
441449
assert_eq!(env.len(), 2);
442450
assert_eq!(
443451
env.get("GEM_PATH").unwrap(),
444-
"/test/gem_home:/test/gem_path"
452+
&format!("{gem_home}:{TEST_GEM_PATH}")
445453
);
446-
assert_eq!(env.get("PATH").unwrap(), "/usr/bin:/test/gem_home/bin");
454+
assert_eq!(env.get("PATH").unwrap(), &format!("/usr/bin:{gem_bin}"));
447455
}
448456

449457
#[test]

0 commit comments

Comments
 (0)