diff --git a/README.md b/README.md index 924c152..5462fb6 100644 --- a/README.md +++ b/README.md @@ -6,17 +6,7 @@ `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. diff --git a/doc/diagram-thumb.png b/doc/diagram-thumb.png new file mode 100644 index 0000000..858dd7a Binary files /dev/null and b/doc/diagram-thumb.png differ diff --git a/doc/diagram.png b/doc/diagram.png new file mode 100644 index 0000000..d234344 Binary files /dev/null and b/doc/diagram.png differ diff --git a/doc/diagram.svg b/doc/diagram.svg new file mode 100644 index 0000000..1641737 --- /dev/null +++ b/doc/diagram.svg @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + $ cargo fixture args... + cargo test args... + fixture.rs - main() { ... setup ... ready() → ... teardown ...} + + + +