File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -358,3 +358,27 @@ fn test_warn_succeed_if_rustup_sh_already_installed_y_flag() {
358
358
assert ! ( !out. stdout. contains( "Continue? (y/N)" ) ) ;
359
359
} )
360
360
}
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
+ }
You can’t perform that action at this time.
0 commit comments