Skip to content

Commit b16e059

Browse files
rami3ldjc
authored andcommitted
Refactor test case install_uninstall_affect_path
1 parent e23a019 commit b16e059

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

tests/suite/cli_paths.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -362,22 +362,19 @@ mod windows {
362362
fn install_uninstall_affect_path() {
363363
clitools::test(Scenario::Empty, &|config| {
364364
with_saved_path(&mut || {
365-
let path = config.cargodir.join("bin").display().to_string();
365+
let cfg_path = config.cargodir.join("bin").display().to_string();
366+
let get_path_ = || get_path().unwrap().unwrap().to_string();
366367

367368
config.expect_ok(&INIT_NONE);
368369
assert!(
369-
get_path()
370-
.unwrap()
371-
.unwrap()
372-
.to_string()
373-
.contains(path.trim_matches('"')),
370+
get_path_().contains(cfg_path.trim_matches('"')),
374371
"`{}` not in `{}`",
375-
path,
376-
get_path().unwrap().unwrap()
372+
cfg_path,
373+
get_path_()
377374
);
378375

379376
config.expect_ok(&["rustup", "self", "uninstall", "-y"]);
380-
assert!(!get_path().unwrap().unwrap().to_string().contains(&path));
377+
assert!(!get_path_().contains(&cfg_path));
381378
})
382379
});
383380
}

0 commit comments

Comments
 (0)