From 2c147e1dcc44774d3095ed791820d10fbf031d7e Mon Sep 17 00:00:00 2001 From: Teo Stocco Date: Sun, 26 Feb 2023 22:42:53 +0100 Subject: [PATCH] feat: add hydrate_one --- .github/workflows/tests.yml | 1 + Cargo.toml | 3 +++ src/main.rs | 16 ++++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d1c5f4e..a316478 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,4 +21,5 @@ jobs: with: key: ${{ runner.os }} - run: | + cargo run -- --help cargo test diff --git a/Cargo.toml b/Cargo.toml index 5ed4f0a..dfdb41d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,3 +32,6 @@ env_logger = "0.10.0" openssl = { version = "0.10.45", features = ["vendored"] } serde_json = "1.0.93" +[dev-dependencies] +assert_cmd = "2.0.8" + diff --git a/src/main.rs b/src/main.rs index a97afa5..e570905 100644 --- a/src/main.rs +++ b/src/main.rs @@ -95,3 +95,19 @@ async fn main() -> Result<()> { } } } + +#[test] +fn verify_cli() { + use crate::Args; + use clap::CommandFactory; + Args::command().debug_assert() +} + +#[test] +fn end_to_end() { + // need build before running this test + use assert_cmd::Command; + + let mut cmd = Command::cargo_bin("lade").unwrap(); + cmd.arg("-h").assert().success(); +}