pub struct MockFoo { /* private fields */ }Expand description
Mock of a basic trait with several kinds of method.
It is mocked by the MockFoo struct.
Implementations§
source§impl MockFoo
impl MockFoo
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 MockFoo
impl MockFoo
sourcepub fn expect_foo(&mut self) -> &mut Expectation
pub fn expect_foo(&mut self) -> &mut Expectation
Create an Expectation for mocking the foo method
sourcepub fn expect_bar(&mut self) -> &mut Expectation
pub fn expect_bar(&mut self) -> &mut Expectation
Create an Expectation for mocking the bar method
sourcepub fn expect_baz(&mut self) -> &mut Expectation
pub fn expect_baz(&mut self) -> &mut Expectation
Create an Expectation for mocking the baz method
sourcepub fn expect_bean(&mut self) -> &mut Expectation
pub fn expect_bean(&mut self) -> &mut Expectation
Create an Expectation for mocking the bean method
sourcepub fn bang_context() -> Context
pub fn bang_context() -> Context
Create a Context for mocking the bang method
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for MockFoo
impl Send for MockFoo
impl Sync for MockFoo
impl Unpin for MockFoo
impl !UnwindSafe for MockFoo
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