@@ -354,11 +354,19 @@ async fn file_override_toolchain_err_handling() {
354
354
async fn plus_override_toolchain_err_handling ( ) {
355
355
let cx = CliTestContext :: new ( Scenario :: SimpleV2 ) . await ;
356
356
cx. config
357
- . expect_err (
358
- & [ "rustc" , "+beta" ] ,
357
+ . expect_err_env (
358
+ & [ "rustc" , "+beta" , "--version" ] ,
359
+ & [ ( "RUSTUP_AUTO_INSTALL" , "0" ) ] ,
359
360
for_host ! ( "toolchain 'beta-{0}' is not installed" ) ,
360
361
)
361
362
. 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 ;
362
370
}
363
371
364
372
#[ tokio:: test]
@@ -776,8 +784,9 @@ async fn upgrade_v2_to_v1() {
776
784
async fn list_targets_no_toolchain ( ) {
777
785
let cx = CliTestContext :: new ( Scenario :: SimpleV2 ) . await ;
778
786
cx. config
779
- . expect_err (
787
+ . expect_err_env (
780
788
& [ "rustup" , "target" , "list" , "--toolchain=nightly" ] ,
789
+ & [ ( "RUSTUP_AUTO_INSTALL" , "0" ) ] ,
781
790
for_host ! ( "toolchain 'nightly-{0}' is not installed" ) ,
782
791
)
783
792
. await ;
@@ -962,18 +971,20 @@ async fn remove_target_by_component_remove() {
962
971
async fn add_target_no_toolchain ( ) {
963
972
let cx = CliTestContext :: new ( Scenario :: SimpleV2 ) . await ;
964
973
cx. config
965
- . expect_err (
974
+ . expect_err_env (
966
975
& [
967
976
"rustup" ,
968
977
"target" ,
969
978
"add" ,
970
979
CROSS_ARCH1 ,
971
980
"--toolchain=nightly" ,
972
981
] ,
982
+ & [ ( "RUSTUP_AUTO_INSTALL" , "0" ) ] ,
973
983
for_host ! ( "toolchain 'nightly-{0}' is not installed" ) ,
974
984
)
975
985
. await ;
976
986
}
987
+
977
988
#[ tokio:: test]
978
989
async fn add_target_bogus ( ) {
979
990
let mut cx = CliTestContext :: new ( Scenario :: SimpleV2 ) . await ;
@@ -1120,14 +1131,15 @@ async fn remove_target_not_installed() {
1120
1131
async fn remove_target_no_toolchain ( ) {
1121
1132
let cx = CliTestContext :: new ( Scenario :: SimpleV2 ) . await ;
1122
1133
cx. config
1123
- . expect_err (
1134
+ . expect_err_env (
1124
1135
& [
1125
1136
"rustup" ,
1126
1137
"target" ,
1127
1138
"remove" ,
1128
1139
CROSS_ARCH1 ,
1129
1140
"--toolchain=nightly" ,
1130
1141
] ,
1142
+ & [ ( "RUSTUP_AUTO_INSTALL" , "0" ) ] ,
1131
1143
for_host ! ( "toolchain 'nightly-{0}' is not installed" ) ,
1132
1144
)
1133
1145
. await ;
0 commit comments