pub struct MockBoo { /* private fields */ }
Expand description
Mock of a struct
Structs can be mocked with mock!
.
Their mock methods have an identical API to the methods generated by
#[automock]
.
Implementations§
source§impl MockBoo
impl MockBoo
sourcepub fn checkpoint(&mut self)
pub fn checkpoint(&mut self)
Validate that all current expectations for all methods have been satisfied, and discard them.
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new mock object with no expectations.
This method will not be generated if the real struct
already has a new
method. However, it will be
generated if the struct implements a trait with a new
method. The trait’s new
method can still be called
like <MockX as TraitY>::new
source§impl MockBoo
impl MockBoo
sourcepub fn expect_bah(&mut self) -> &mut Expectation
pub fn expect_bah(&mut self) -> &mut Expectation
Create an Expectation
for mocking the bah
method
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MockBoo
impl RefUnwindSafe for MockBoo
impl Send for MockBoo
impl Sync for MockBoo
impl Unpin for MockBoo
impl UnwindSafe for MockBoo
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more