@@ -905,3 +905,67 @@ fn which() {
905
905
) ;
906
906
} ) ;
907
907
}
908
+
909
+ #[ test]
910
+ fn install_toolchain_by_rustup_run_with_install_flag ( ) {
911
+ setup ( & |config| {
912
+ expect_ok ( config, & [ "rustup" , "toolchain" , "remove" , "nightly" ] ) ;
913
+ expect_ok_ex (
914
+ config,
915
+ & [
916
+ "rustup" ,
917
+ "run" ,
918
+ "--install" ,
919
+ "nightly" ,
920
+ "rustc" ,
921
+ "--version" ,
922
+ ] ,
923
+ "1.3.0 (hash-nightly-2)
924
+ " ,
925
+ for_host ! (
926
+ r"info: syncing channel updates for 'nightly-{0}'
927
+ info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
928
+ info: downloading component 'cargo'
929
+ info: downloading component 'rust-docs'
930
+ info: downloading component 'rust-std'
931
+ info: downloading component 'rustc'
932
+ info: installing component 'cargo'
933
+ info: installing component 'rust-docs'
934
+ info: installing component 'rust-std'
935
+ info: installing component 'rustc'
936
+ "
937
+ ) ,
938
+ ) ;
939
+ } ) ;
940
+ }
941
+
942
+ #[ test]
943
+ fn install_toolchain_by_rustup_default_with_toolchain_arg ( ) {
944
+ setup ( & |config| {
945
+ expect_ok ( config, & [ "rustup" , "toolchain" , "remove" , "nightly" ] ) ;
946
+ expect_ok_ex (
947
+ config,
948
+ & [ "rustup" , "default" , "nightly" ] ,
949
+ for_host ! (
950
+ r"
951
+ nightly-{0} installed - 1.3.0 (hash-nightly-2)
952
+
953
+ "
954
+ ) ,
955
+ for_host ! (
956
+ r"info: syncing channel updates for 'nightly-{0}'
957
+ info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2)
958
+ info: downloading component 'cargo'
959
+ info: downloading component 'rust-docs'
960
+ info: downloading component 'rust-std'
961
+ info: downloading component 'rustc'
962
+ info: installing component 'cargo'
963
+ info: installing component 'rust-docs'
964
+ info: installing component 'rust-std'
965
+ info: installing component 'rustc'
966
+ info: default toolchain set to 'nightly-{0}'
967
+ "
968
+ ) ,
969
+ ) ;
970
+ } ) ;
971
+ }
0 commit comments