From feedf345a36c0f39e67fbd5f3fabc65c5425ac16 Mon Sep 17 00:00:00 2001 From: xla Date: Thu, 16 Feb 2023 18:24:36 +1100 Subject: [PATCH] cli-test: Complete cargo metadata Signed-off-by: xla --- Cargo.lock | 2 +- radicle-cli-test/Cargo.toml | 13 +++++++++++-- radicle-cli-test/README.md | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 radicle-cli-test/README.md diff --git a/Cargo.lock b/Cargo.lock index 75088fcc..c950eecd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1869,7 +1869,7 @@ dependencies = [ [[package]] name = "radicle-cli-test" -version = "0.1.0" +version = "0.1.1" dependencies = [ "log", "pretty_assertions", diff --git a/radicle-cli-test/Cargo.toml b/radicle-cli-test/Cargo.toml index c8410d22..650d64e5 100644 --- a/radicle-cli-test/Cargo.toml +++ b/radicle-cli-test/Cargo.toml @@ -1,9 +1,18 @@ [package] name = "radicle-cli-test" license = "MIT OR Apache-2.0" -version = "0.1.0" -authors = ["Alexis Sellier "] +version = "0.1.1" +authors = [ + "Alexis Sellier ", + "xla " +] edition = "2021" +rust-version = "1.67" +repository = "https://github.com/radicle-dev/heartwood" +description = "Test your cli with markdown descriptions" +categories = ["development-tools::testing"] +keywords = ["cli", "test", "command"] +readme = "README.md" [dependencies] log = { version = "0.4", features = ["std"] } diff --git a/radicle-cli-test/README.md b/radicle-cli-test/README.md new file mode 100644 index 00000000..f94828b3 --- /dev/null +++ b/radicle-cli-test/README.md @@ -0,0 +1,35 @@ +# radicle-cli-test + +Test your CLI with the help of markdown descriptions. + +## Example + +Test flows are described in markdown like this example: + +````` markdown +# Echoing works + +When I call echo, it answers: + +``` +$ echo "ohai" +ohai +``` +````` + +Say this is placed in `kind-echo.md`, this is what the corresponding test case +would look lke: + +``` rust +use std::path::Path; +use radicle_cli_test::TestFormula; + +#[test] +fn kind_echo() { + TestFormula::new() + .file(Path::new("./kind-echo.md")) + .unwrap() + .run() + .unwrap(); +} +```