tanzim-testing
A tiny, dependency-light test sandbox for the tanzim workspace.
Environment runs a closure inside a fresh temporary directory:
it chdirs into that directory, snapshots the whole process environment, and — when the closure
returns (or panics) — restores the environment and working directory and deletes the temporary
directory. Every run is serialized behind a process-global lock, so it is safe to use from tests
that the harness runs in parallel.
Use it to make tests and examples self-contained: create the files and environment variables a piece of configuration code expects, exercise it, and let the sandbox clean up after itself.
Example
use run;
run
.unwrap;
Prior art
The idea is inspired by the Jail feature of the figment
crate.