@@ -11,10 +11,7 @@ use rustup::test::this_host_triple;
11
11
use rustup:: test:: with_saved_path;
12
12
use rustup:: utils:: raw;
13
13
14
- use crate :: mock:: clitools:: {
15
- self , expect_err, expect_ok, expect_stderr_ok, expect_stdout_ok, run, set_current_dist_date,
16
- Config , SanitizedOutput , Scenario ,
17
- } ;
14
+ use crate :: mock:: clitools:: { self , set_current_dist_date, Config , SanitizedOutput , Scenario } ;
18
15
19
16
fn run_input ( config : & Config , args : & [ & str ] , input : & str ) -> SanitizedOutput {
20
17
run_input_with_env ( config, args, input, & [ ] )
@@ -132,7 +129,7 @@ fn smoke_case_install_with_path_install() {
132
129
#[ test]
133
130
fn blank_lines_around_stderr_log_output_update ( ) {
134
131
clitools:: setup ( Scenario :: SimpleV2 , & |config| {
135
- expect_ok ( config , & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
132
+ config . expect_ok ( & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
136
133
let out = run_input (
137
134
config,
138
135
& [ "rustup-init" , "--no-update-default-toolchain" ] ,
@@ -293,7 +290,7 @@ fn with_no_toolchain() {
293
290
) ;
294
291
assert ! ( out. ok) ;
295
292
296
- expect_stdout_ok ( config , & [ "rustup" , "show" ] , "no active toolchain" ) ;
293
+ config . expect_stdout_ok ( & [ "rustup" , "show" ] , "no active toolchain" ) ;
297
294
} ) ;
298
295
}
299
296
@@ -311,7 +308,7 @@ fn with_non_default_toolchain_still_prompts() {
311
308
) ;
312
309
assert ! ( out. ok) ;
313
310
314
- expect_stdout_ok ( config , & [ "rustup" , "show" ] , "nightly" ) ;
311
+ config . expect_stdout_ok ( & [ "rustup" , "show" ] , "nightly" ) ;
315
312
} ) ;
316
313
}
317
314
@@ -329,8 +326,8 @@ fn with_non_release_channel_non_default_toolchain() {
329
326
) ;
330
327
assert ! ( out. ok) ;
331
328
332
- expect_stdout_ok ( config , & [ "rustup" , "show" ] , "nightly" ) ;
333
- expect_stdout_ok ( config , & [ "rustup" , "show" ] , "2015-01-02" ) ;
329
+ config . expect_stdout_ok ( & [ "rustup" , "show" ] , "nightly" ) ;
330
+ config . expect_stdout_ok ( & [ "rustup" , "show" ] , "2015-01-02" ) ;
334
331
} ) ;
335
332
}
336
333
@@ -344,7 +341,7 @@ fn set_nightly_toolchain() {
344
341
) ;
345
342
assert ! ( out. ok) ;
346
343
347
- expect_stdout_ok ( config , & [ "rustup" , "show" ] , "nightly" ) ;
344
+ config . expect_stdout_ok ( & [ "rustup" , "show" ] , "nightly" ) ;
348
345
} ) ;
349
346
}
350
347
@@ -376,7 +373,7 @@ fn set_nightly_toolchain_and_unset() {
376
373
println ! ( "{:?}" , out. stdout) ;
377
374
assert ! ( out. ok) ;
378
375
379
- expect_stdout_ok ( config , & [ "rustup" , "show" ] , "beta" ) ;
376
+ config . expect_stdout_ok ( & [ "rustup" , "show" ] , "beta" ) ;
380
377
} ) ;
381
378
}
382
379
@@ -400,14 +397,9 @@ fn install_with_components() {
400
397
args. extend_from_slice ( comp_args) ;
401
398
402
399
clitools:: setup ( Scenario :: SimpleV2 , & |config| {
403
- expect_ok ( config, & args) ;
404
- expect_stdout_ok (
405
- config,
406
- & [ "rustup" , "component" , "list" ] ,
407
- "rust-src (installed)" ,
408
- ) ;
409
- expect_stdout_ok (
410
- config,
400
+ config. expect_ok ( & args) ;
401
+ config. expect_stdout_ok ( & [ "rustup" , "component" , "list" ] , "rust-src (installed)" ) ;
402
+ config. expect_stdout_ok (
411
403
& [ "rustup" , "component" , "list" ] ,
412
404
& format ! ( "rust-analysis-{} (installed)" , this_host_triple( ) ) ,
413
405
) ;
@@ -445,8 +437,7 @@ fn install_forces_and_skips_rls() {
445
437
#[ test]
446
438
fn test_warn_if_complete_profile_is_used ( ) {
447
439
clitools:: setup ( Scenario :: SimpleV2 , & |config| {
448
- expect_stderr_ok (
449
- config,
440
+ config. expect_stderr_ok (
450
441
& [
451
442
"rustup-init" ,
452
443
"-y" ,
@@ -513,7 +504,7 @@ fn test_prompt_succeed_if_rustup_sh_already_installed_reply_yes() {
513
504
#[ test]
514
505
fn installing_when_already_installed_updates_toolchain ( ) {
515
506
clitools:: setup ( Scenario :: SimpleV2 , & |config| {
516
- expect_ok ( config , & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
507
+ config . expect_ok ( & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
517
508
let out = run_input ( config, & [ "rustup-init" , "--no-modify-path" ] , "\n \n " ) ;
518
509
println ! ( "stdout:\n {}\n ...\n " , out. stdout) ;
519
510
assert ! ( out
@@ -534,8 +525,7 @@ fn install_stops_if_rustc_exists() {
534
525
let temp_dir_path = temp_dir. path ( ) . to_str ( ) . unwrap ( ) ;
535
526
536
527
clitools:: setup ( Scenario :: SimpleV2 , & |config| {
537
- let out = run (
538
- config,
528
+ let out = config. run (
539
529
"rustup-init" ,
540
530
& [ "--no-modify-path" ] ,
541
531
& [
@@ -565,8 +555,7 @@ fn install_stops_if_cargo_exists() {
565
555
let temp_dir_path = temp_dir. path ( ) . to_str ( ) . unwrap ( ) ;
566
556
567
557
clitools:: setup ( Scenario :: SimpleV2 , & |config| {
568
- let out = run (
569
- config,
558
+ let out = config. run (
570
559
"rustup-init" ,
571
560
& [ "--no-modify-path" ] ,
572
561
& [
@@ -596,8 +585,7 @@ fn with_no_prompt_install_succeeds_if_rustc_exists() {
596
585
let temp_dir_path = temp_dir. path ( ) . to_str ( ) . unwrap ( ) ;
597
586
598
587
clitools:: setup ( Scenario :: SimpleV2 , & |config| {
599
- let out = run (
600
- config,
588
+ let out = config. run (
601
589
"rustup-init" ,
602
590
& [ "-y" , "--no-modify-path" ] ,
603
591
& [
@@ -613,8 +601,7 @@ fn with_no_prompt_install_succeeds_if_rustc_exists() {
613
601
#[ test]
614
602
fn install_non_installable_toolchain ( ) {
615
603
clitools:: setup ( Scenario :: Unavailable , & |config| {
616
- expect_err (
617
- config,
604
+ config. expect_err (
618
605
& [
619
606
"rustup-init" ,
620
607
"-y" ,
0 commit comments