Skip to content

Commit 0e2333d

Browse files
committed
Added test for RUSTUP_INIT_SKIP_CHECKING_EXISTENCE.
1 parent 8095f81 commit 0e2333d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/cli-inst-interactive.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,3 +358,22 @@ fn test_warn_succeed_if_rustup_sh_already_installed_y_flag() {
358358
assert!(!out.stdout.contains("Continue? (y/N)"));
359359
})
360360
}
361+
362+
#[test]
363+
fn test_succeed_if_rustup_sh_already_installed_env_var_set() {
364+
setup(&|config| {
365+
create_rustup_sh_metadata(&config);
366+
let out = run_input_with_env(config, &["rustup-init", "-y"], "", &[("RUSTUP_INIT_SKIP_EXISTENCE_CHECKS", "yes")]);
367+
assert!(out.ok);
368+
assert!(!out
369+
.stderr
370+
.contains("warning: it looks like you have existing rustup.sh metadata"));
371+
assert!(!out
372+
.stderr
373+
.contains("error: cannot install while rustup.sh is installed"));
374+
assert!(!out.stderr.contains(
375+
"warning: continuing (because the -y flag is set and the error is ignorable)"
376+
));
377+
assert!(!out.stdout.contains("Continue? (y/N)"));
378+
})
379+
}

0 commit comments

Comments
 (0)