@@ -354,11 +354,19 @@ async fn file_override_toolchain_err_handling() {
354354async fn plus_override_toolchain_err_handling ( ) {
355355 let cx = CliTestContext :: new ( Scenario :: SimpleV2 ) . await ;
356356 cx. config
357- . expect_err (
358- & [ "rustc" , "+beta" ] ,
357+ . expect_err_env (
358+ & [ "rustc" , "+beta" , "--version" ] ,
359+ & [ ( "RUSTUP_AUTO_INSTALL" , "0" ) ] ,
359360 for_host ! ( "toolchain 'beta-{0}' is not installed" ) ,
360361 )
361362 . await ;
363+ cx. config
364+ . expect_ok_contains (
365+ & [ "rustc" , "+beta" , "--version" ] ,
366+ "1.2.0 (hash-beta-1.2.0)" ,
367+ "" ,
368+ )
369+ . await ;
362370}
363371
364372#[ tokio:: test]
@@ -776,8 +784,9 @@ async fn upgrade_v2_to_v1() {
776784async fn list_targets_no_toolchain ( ) {
777785 let cx = CliTestContext :: new ( Scenario :: SimpleV2 ) . await ;
778786 cx. config
779- . expect_err (
787+ . expect_err_env (
780788 & [ "rustup" , "target" , "list" , "--toolchain=nightly" ] ,
789+ & [ ( "RUSTUP_AUTO_INSTALL" , "0" ) ] ,
781790 for_host ! ( "toolchain 'nightly-{0}' is not installed" ) ,
782791 )
783792 . await ;
@@ -962,18 +971,20 @@ async fn remove_target_by_component_remove() {
962971async fn add_target_no_toolchain ( ) {
963972 let cx = CliTestContext :: new ( Scenario :: SimpleV2 ) . await ;
964973 cx. config
965- . expect_err (
974+ . expect_err_env (
966975 & [
967976 "rustup" ,
968977 "target" ,
969978 "add" ,
970979 CROSS_ARCH1 ,
971980 "--toolchain=nightly" ,
972981 ] ,
982+ & [ ( "RUSTUP_AUTO_INSTALL" , "0" ) ] ,
973983 for_host ! ( "toolchain 'nightly-{0}' is not installed" ) ,
974984 )
975985 . await ;
976986}
987+
977988#[ tokio:: test]
978989async fn add_target_bogus ( ) {
979990 let mut cx = CliTestContext :: new ( Scenario :: SimpleV2 ) . await ;
@@ -1120,14 +1131,15 @@ async fn remove_target_not_installed() {
11201131async fn remove_target_no_toolchain ( ) {
11211132 let cx = CliTestContext :: new ( Scenario :: SimpleV2 ) . await ;
11221133 cx. config
1123- . expect_err (
1134+ . expect_err_env (
11241135 & [
11251136 "rustup" ,
11261137 "target" ,
11271138 "remove" ,
11281139 CROSS_ARCH1 ,
11291140 "--toolchain=nightly" ,
11301141 ] ,
1142+ & [ ( "RUSTUP_AUTO_INSTALL" , "0" ) ] ,
11311143 for_host ! ( "toolchain 'nightly-{0}' is not installed" ) ,
11321144 )
11331145 . await ;
0 commit comments