Skip to content

Commit ac5105f

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

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/cli-inst-interactive.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,3 +358,27 @@ 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(
367+
config,
368+
&["rustup-init", "-y"],
369+
"",
370+
&[("RUSTUP_INIT_SKIP_EXISTENCE_CHECKS", "yes")],
371+
);
372+
assert!(out.ok);
373+
assert!(!out
374+
.stderr
375+
.contains("warning: it looks like you have existing rustup.sh metadata"));
376+
assert!(!out
377+
.stderr
378+
.contains("error: cannot install while rustup.sh is installed"));
379+
assert!(!out.stderr.contains(
380+
"warning: continuing (because the -y flag is set and the error is ignorable)"
381+
));
382+
assert!(!out.stdout.contains("Continue? (y/N)"));
383+
})
384+
}

0 commit comments

Comments
 (0)