Skip to content

Commit

Permalink
Test partially successful uninstallation
Browse files Browse the repository at this point in the history
  • Loading branch information
nossralf committed Oct 28, 2017
1 parent cf58031 commit 05224d6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -970,3 +970,24 @@ fn uninstall_multiple_and_specifying_bin() {
error: A binary can only be associated with a single installed package, specifying multiple specs with --bin is redundant.
"));
}

#[test]
fn uninstall_multiple_and_some_pkg_does_not_exist() {
pkg("foo", "0.0.1");

assert_that(cargo_process("install").arg("foo"),
execs().with_status(0));

assert_that(cargo_process("uninstall").args(&["foo", "bar"]),
execs().with_status(101).with_stderr(&format!("\
[REMOVING] {home}[..]bin[..]foo[..]
error: package id specification `bar` matched no packages
Summary: Successfully uninstalled foo! Failed to uninstall bar (see error(s) above).
error: some packages failed to uninstall
",
home = cargo_home().display())));

assert_that(cargo_home(), is_not(has_installed_exe("foo")));
assert_that(cargo_home(), is_not(has_installed_exe("bar")));
}

0 comments on commit 05224d6

Please sign in to comment.