pub struct FakeExecutor { /* private fields */ }Expand description
Deterministic test executor with scripted responses.
Implementations§
Source§impl FakeExecutor
impl FakeExecutor
Sourcepub fn expect(&self, argv: &[&str], output: ManagerCommandOutput)
pub fn expect(&self, argv: &[&str], output: ManagerCommandOutput)
Scripts a successful response for the next matching call.
§Panics
Panics if the internal expectation lock is poisoned by a panic in another thread that also used this executor.
Sourcepub fn expect_error(&self, argv: &[&str], err: ServiceError)
pub fn expect_error(&self, argv: &[&str], err: ServiceError)
Scripts a failure for the next matching call.
§Panics
Panics if the internal expectation lock is poisoned by a panic in another thread that also used this executor.
Sourcepub fn calls(&self) -> Vec<FakeCall>
pub fn calls(&self) -> Vec<FakeCall>
Returns all observed calls in order.
§Panics
Panics if the internal call lock is poisoned by a panic in another thread that also used this executor.
Sourcepub fn call_count(&self) -> usize
pub fn call_count(&self) -> usize
Returns the number of observed calls.
§Panics
Panics if the internal call lock is poisoned by a panic in another thread that also used this executor.
Sourcepub fn is_exhausted(&self) -> bool
pub fn is_exhausted(&self) -> bool
Returns true when all expectations were consumed.
§Panics
Panics if the internal expectation lock is poisoned by a panic in another thread that also used this executor.