Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
durka committed Mar 17, 2017
1 parent dd59773 commit a807244
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/cli-v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,32 @@ fn remove_toolchain() {
});
}

#[test]
fn add_remove_multiple_toolchains() {
fn go(add: &str, rm: &str) {
setup(&|config| {
let tch1 = "beta";
let tch2 = "nightly";

expect_ok(config, &["rustup", "toolchain", add, tch1, tch2]);
expect_ok(config, &["rustup", "toolchain", "list"]);
expect_stdout_ok(config, &["rustup", "toolchain", "list"], tch1);
expect_stdout_ok(config, &["rustup", "toolchain", "list"], tch2);

expect_ok(config, &["rustup", "toolchain", rm, tch1, tch2]);
expect_ok(config, &["rustup", "toolchain", "list"]);
expect_not_stdout_ok(config, &["rustup", "toolchain", "list"], tch1);
expect_not_stdout_ok(config, &["rustup", "toolchain", "list"], tch2);
});
}

for add in &["add", "update", "install"] {
for rm in &["remove", "uninstall"] {
go(add, rm);
}
}
}

#[test]
fn remove_default_toolchain_err_handling() {
setup(&|config| {
Expand Down

0 comments on commit a807244

Please sign in to comment.