Skip to content

Commit

Permalink
Test(ship): Add test to ensure self-update customization works
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Mabileau <[email protected]>
  • Loading branch information
PaulDance committed Sep 21, 2024
1 parent 29d3229 commit 44f3016
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/ship.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,30 @@ fn validate_ship_manynewer_update() {
fixture_assert_installed();
}

/// Checks that configuration can indeed apply to ourselves too.
#[cargo_test]
fn validate_ship_selfupdate_customization() {
let _reg = init_registry();
fake_publish("cargo-liner", "0.0.3");
fake_install("cargo-liner", "0.0.3", false);
assert_installed("cargo-liner");
// Use `--force` for simplicity: just checking the flag is passed is enough.
write_user_config(&[
"[packages]",
"cargo-liner = { version = '*', force = true }",
]);

cargo_liner()
.args(["ship", "--skip-check", "--only-self"])
.assert()
.success()
.stdout_eq("".into_data().raw())
.stderr_eq(snapbox::file![
"fixtures/ship/validate_ship_skipcheck_force_update.stderr"
]);
assert_installed("cargo-liner");
}

#[cargo_test]
fn validate_ship_features_simple_none() {
let _reg = init_registry();
Expand Down

0 comments on commit 44f3016

Please sign in to comment.