From 6181e8d484f1c8bda1e880061a1142ee2fb626e4 Mon Sep 17 00:00:00 2001 From: Perry Hertler Date: Fri, 9 Aug 2024 14:41:22 -0500 Subject: [PATCH] aliasing "update" with "update-todo" for packwerk parity (#6) --- Cargo.toml | 2 +- src/packs/cli.rs | 3 ++- tests/update_test.rs | 14 ++++++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bd09c84..03b25ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "pks" -version = "0.2.19" +version = "0.2.20" edition = "2021" description = "Welcome! Please see https://github.com/rubyatscale/pks for more information!" license = "MIT" diff --git a/src/packs/cli.rs b/src/packs/cli.rs index 5dd300d..66c11bc 100644 --- a/src/packs/cli.rs +++ b/src/packs/cli.rs @@ -83,7 +83,8 @@ enum Command { }, #[clap( - about = "Update package_todo.yml files with the current violations" + about = "Update package_todo.yml files with the current violations", + alias = "update-todo" )] Update, diff --git a/tests/update_test.rs b/tests/update_test.rs index 970ca92..8b3595b 100644 --- a/tests/update_test.rs +++ b/tests/update_test.rs @@ -6,14 +6,24 @@ mod common; use pretty_assertions::assert_eq; #[test] +#[serial] // This and the next test are run in serial because they both use the same fixtures. +fn update() -> Result<(), Box> { + test_update("update") +} + +#[test] #[serial] -fn test_update() -> Result<(), Box> { +fn update_todo() -> Result<(), Box> { + test_update("update-todo") +} + +fn test_update(command: &str) -> Result<(), Box> { Command::cargo_bin("pks")? .arg("--project-root") .arg("tests/fixtures/simple_app") .arg("--debug") - .arg("update") + .arg(command) .assert() .success() .stdout(predicate::str::contains(