diff --git a/README.md b/README.md index e6f2a0b..a073c7b 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,12 @@ Data can be passed from fixture to tests using environment variables, in-memory - [HTTP server](examples/http) - [DB in a Docker container](examples/docker) +### Installation + +```sh +cargo install -f cargo-fixture +``` + ### Getting started The `cargo fixture` command is a drop-in replacement for the `cargo test` command with the difference that it starts a _fixture_ before running `cargo test`. The fixture continues running while `cargo test` runs, it is then told about test success and is given time to perform cleanup. @@ -64,6 +70,22 @@ async fn some_test(client: TestClient) { The `#[with_fixture]` macro marks the test `#[ignore]` outside of the `_fixture` feature, so that when you run plain old `cargo test`, the test that require fixture are simply skipped! This way, you can have a hefty fixture but still run unit tests using just `cargo test` very quickly. +### Multiple fixtures + +Use `cargo fixture -F ` to use a fixture program different than the default (`fixture`). + +### Troubleshooting fixtures + +The `-x` flag lets you replace the `cargo test` command with a custom one. You can use this to run a shell instead of `cargo test`: + +```sh +cargo fixture -x sh +``` + +This will ready the fixture and then enter a shell, in which you can inspect whether the fixture environment is prepared correctly, interact with it, or even run `cargo test` and interact with the environment post-tests. + ### Platform support -FIXME: async runtimes, OSes +Async runtime: [Tokio](https://tokio.rs/), [smol](https://docs.rs/smol). + +OS: Linux, Mac OS, Windows 10 or later.