Sealed test
This crate expose the #[sealed_test] macro attribute to run your test in an isolated environment.
It provides the following :
- an isolated process using rusty-fork and
- a temporary work dir tempfile.
Caution: using #[sealed_test] instead of #[test] will create a temporary file
and set it to be the test current directory but, nothing stops you from changing that directory
using std::env::set_current_dir.
Example
Without sealed_test :
The below bar test will fail because the environment variable will be concurrently altered
by the foo test.
With sealed_test :
Here each test has its own environment, the tests will always pass.
use *;