lucab · GitHub

@lucab

@lucab

@lucab lucab mentioned this pull request

Jun 16, 2019

Merged

@lucab lucab changed the title [DNM] fail: add test-mutex pattern directly to the library fail: add test-mutex pattern directly to the library

Jun 16, 2019
//! let _gaurd = setup();
//! fail::cfg("read-dir", "panic").unwrap();
//! let scenario = FailScenario::setup();
//! scenario.cfg("read-dir", "panic").unwrap();

@lucab

BusyJay

BusyJay previously approved these changes Jul 3, 2019

Luca Bruno

@lucab

@lucab

Luca Bruno

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.

@lucab

Hoverbear

@brson

Read the original on github.com ↗