Skip to content

Commit

Permalink
Test(ship): Add test for config environment
Browse files Browse the repository at this point in the history
Closes #23.

Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
  • Loading branch information
PaulDance committed May 26, 2024
1 parent c06646d commit a8f8078
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/ship.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1125,3 +1125,24 @@ fn validate_ship_extrargs_list() {
])
.stderr_eq_(snapbox::file!["fixtures/ship/validate_ship_extrargs_list.stderr"].raw());
}

/// See #23.
#[cargo_test]
fn validate_ship_environment_list() {
let _reg = init_registry();
fake_install_self();
fake_publish("abc", "0.0.0");
write_user_config(&[
"[packages]",
// HACK: use the quiet control to observe a stable change in behavior.
"abc = { version = '*', environment = { CARGO_TERM_QUIET = 'true' } }",
]);

cargo_liner()
.args(["ship", "--skip-check", "--no-self"])
.assert()
.success()
.stdout_eq_("".into_data().raw())
.stderr_eq_(snapbox::file!["fixtures/ship/validate_ship_extrargs_list.stderr"].raw());
assert_installed("abc");
}

0 comments on commit a8f8078

Please sign in to comment.