diff --git a/README.md b/README.md index cce3c6f..924c152 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,18 @@ `cargo fixture` is a cargo extension that let's you surround `cargo test` with arbitrary Rust setup and teardown code. +In pseudo-code: + +```rust +cargo fixture [args...] { + fixture.rs { + // your setup code + let result = cargo test [args...] + // your cleanup code + } +} +``` + It can be used to run network servers that tests connect to, spin up docker containers, prepare test data, check for presence of programs,... or really anything that can be done from Rust code. Any provided resources can be released after `cargo test` finishes, whether manually, using RAII guards or closures. Data can be passed from fixture to tests using environment variables, in-memory K-V storage, or files. Additionally, the option to define serial tests is provided.