lucab
mentioned this pull request
Merged
lucab
changed the title
[DNM] fail: add test-mutex pattern directly to the library
fail: add test-mutex pattern directly to the library
| //! let _gaurd = setup(); | ||
| //! fail::cfg("read-dir", "panic").unwrap(); | ||
| //! let scenario = FailScenario::setup(); | ||
| //! scenario.cfg("read-dir", "panic").unwrap(); |
BusyJay previously approved these changes Jul 3, 2019
This adds a `FailScenario` to the library, exposing the usual idiom of a global testing mutex and individual guards owned by each test. The global mutex is kept as an internal detail and not exposed, consumers can only borrow a guard via the scenario.