Skip to content

Commit

Permalink
Add test cases for the CLI help menu
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Jul 8, 2024
1 parent 857d2e8 commit a6783f7
Show file tree
Hide file tree
Showing 2 changed files with 824 additions and 0 deletions.
15 changes: 15 additions & 0 deletions crates/uv/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,13 @@ impl TestContext {
}
}

/// Create a `uv` command for testing.
pub fn command(&self) -> Command {
let mut command = Command::new(get_bin());
self.add_shared_args(&mut command);
command
}

/// Shared behaviour for almost all test commands.
///
/// * Use a temporary cache directory
Expand Down Expand Up @@ -359,6 +366,14 @@ impl TestContext {
command
}

/// Create a `uv help` command with options shared across scenarios.
#[allow(clippy::unused_self)]
pub fn help(&self) -> Command {
let mut command = Command::new(get_bin());
command.arg("help");
command
}

/// Create a `uv sync` command with options shared across scenarios.
pub fn sync(&self) -> Command {
let mut command = Command::new(get_bin());
Expand Down
Loading

0 comments on commit a6783f7

Please sign in to comment.