Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nrc committed Jan 9, 2019
1 parent 7d794fa commit 5ec3b70
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/cli-self-upd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,38 @@ fn rustup_self_updates() {
})
}

#[test]
fn rustup_self_updates_with_specified_toolchain() {
update_setup(&|config, _| {
expect_ok(config, &["rustup-init", "-y"]);

let ref bin = config.cargodir.join(&format!("bin/rustup{}", EXE_SUFFIX));
let before_hash = calc_hash(bin);

expect_ok(config, &["rustup", "update", "stable"]);

let after_hash = calc_hash(bin);

assert_ne!(before_hash, after_hash);
})
}

#[test]
fn rustup_no_self_update_with_specified_toolchain() {
update_setup(&|config, _| {
expect_ok(config, &["rustup-init", "-y"]);

let ref bin = config.cargodir.join(&format!("bin/rustup{}", EXE_SUFFIX));
let before_hash = calc_hash(bin);

expect_ok(config, &["rustup", "update", "stable", "--no-self-update"]);

let after_hash = calc_hash(bin);

assert_eq!(before_hash, after_hash);
})
}

#[test]
fn rustup_self_update_exact() {
update_setup(&|config, _| {
Expand Down

0 comments on commit 5ec3b70

Please sign in to comment.