@@ -11,10 +11,7 @@ use rustup::test::this_host_triple;
1111use rustup:: test:: with_saved_path;
1212use rustup:: utils:: raw;
1313
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 } ;
1815
1916fn run_input ( config : & Config , args : & [ & str ] , input : & str ) -> SanitizedOutput {
2017 run_input_with_env ( config, args, input, & [ ] )
@@ -132,7 +129,7 @@ fn smoke_case_install_with_path_install() {
132129#[ test]
133130fn blank_lines_around_stderr_log_output_update ( ) {
134131 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" ] ) ;
136133 let out = run_input (
137134 config,
138135 & [ "rustup-init" , "--no-update-default-toolchain" ] ,
@@ -293,7 +290,7 @@ fn with_no_toolchain() {
293290 ) ;
294291 assert ! ( out. ok) ;
295292
296- expect_stdout_ok ( config , & [ "rustup" , "show" ] , "no active toolchain" ) ;
293+ config . expect_stdout_ok ( & [ "rustup" , "show" ] , "no active toolchain" ) ;
297294 } ) ;
298295}
299296
@@ -311,7 +308,7 @@ fn with_non_default_toolchain_still_prompts() {
311308 ) ;
312309 assert ! ( out. ok) ;
313310
314- expect_stdout_ok ( config , & [ "rustup" , "show" ] , "nightly" ) ;
311+ config . expect_stdout_ok ( & [ "rustup" , "show" ] , "nightly" ) ;
315312 } ) ;
316313}
317314
@@ -329,8 +326,8 @@ fn with_non_release_channel_non_default_toolchain() {
329326 ) ;
330327 assert ! ( out. ok) ;
331328
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" ) ;
334331 } ) ;
335332}
336333
@@ -344,7 +341,7 @@ fn set_nightly_toolchain() {
344341 ) ;
345342 assert ! ( out. ok) ;
346343
347- expect_stdout_ok ( config , & [ "rustup" , "show" ] , "nightly" ) ;
344+ config . expect_stdout_ok ( & [ "rustup" , "show" ] , "nightly" ) ;
348345 } ) ;
349346}
350347
@@ -376,7 +373,7 @@ fn set_nightly_toolchain_and_unset() {
376373 println ! ( "{:?}" , out. stdout) ;
377374 assert ! ( out. ok) ;
378375
379- expect_stdout_ok ( config , & [ "rustup" , "show" ] , "beta" ) ;
376+ config . expect_stdout_ok ( & [ "rustup" , "show" ] , "beta" ) ;
380377 } ) ;
381378}
382379
@@ -400,14 +397,9 @@ fn install_with_components() {
400397 args. extend_from_slice ( comp_args) ;
401398
402399 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 (
411403 & [ "rustup" , "component" , "list" ] ,
412404 & format ! ( "rust-analysis-{} (installed)" , this_host_triple( ) ) ,
413405 ) ;
@@ -445,8 +437,7 @@ fn install_forces_and_skips_rls() {
445437#[ test]
446438fn test_warn_if_complete_profile_is_used ( ) {
447439 clitools:: setup ( Scenario :: SimpleV2 , & |config| {
448- expect_stderr_ok (
449- config,
440+ config. expect_stderr_ok (
450441 & [
451442 "rustup-init" ,
452443 "-y" ,
@@ -513,7 +504,7 @@ fn test_prompt_succeed_if_rustup_sh_already_installed_reply_yes() {
513504#[ test]
514505fn installing_when_already_installed_updates_toolchain ( ) {
515506 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" ] ) ;
517508 let out = run_input ( config, & [ "rustup-init" , "--no-modify-path" ] , "\n \n " ) ;
518509 println ! ( "stdout:\n {}\n ...\n " , out. stdout) ;
519510 assert ! ( out
@@ -534,8 +525,7 @@ fn install_stops_if_rustc_exists() {
534525 let temp_dir_path = temp_dir. path ( ) . to_str ( ) . unwrap ( ) ;
535526
536527 clitools:: setup ( Scenario :: SimpleV2 , & |config| {
537- let out = run (
538- config,
528+ let out = config. run (
539529 "rustup-init" ,
540530 & [ "--no-modify-path" ] ,
541531 & [
@@ -565,8 +555,7 @@ fn install_stops_if_cargo_exists() {
565555 let temp_dir_path = temp_dir. path ( ) . to_str ( ) . unwrap ( ) ;
566556
567557 clitools:: setup ( Scenario :: SimpleV2 , & |config| {
568- let out = run (
569- config,
558+ let out = config. run (
570559 "rustup-init" ,
571560 & [ "--no-modify-path" ] ,
572561 & [
@@ -596,8 +585,7 @@ fn with_no_prompt_install_succeeds_if_rustc_exists() {
596585 let temp_dir_path = temp_dir. path ( ) . to_str ( ) . unwrap ( ) ;
597586
598587 clitools:: setup ( Scenario :: SimpleV2 , & |config| {
599- let out = run (
600- config,
588+ let out = config. run (
601589 "rustup-init" ,
602590 & [ "-y" , "--no-modify-path" ] ,
603591 & [
@@ -613,8 +601,7 @@ fn with_no_prompt_install_succeeds_if_rustc_exists() {
613601#[ test]
614602fn install_non_installable_toolchain ( ) {
615603 clitools:: setup ( Scenario :: Unavailable , & |config| {
616- expect_err (
617- config,
604+ config. expect_err (
618605 & [
619606 "rustup-init" ,
620607 "-y" ,
0 commit comments