use std::fmt::Debug; use std::marker::PhantomData; use murf::{action::Return, expect_method_call, mock}; trait Fuu { fn fuu(&self) -> usize; } #[derive(Default)] pub struct MyStruct(PhantomData); impl Fuu for MyStruct { fn fuu(&self) -> usize { 6 } } mock! { impl Fuu for MyStruct { fn fuu(&self) -> usize; } } #[test] fn success() { let (handle, mock) = MyStruct::::mock_with_handle(); expect_method_call!(handle as Fuu, fuu()).times(1); expect_method_call!(handle as Fuu, fuu()).will_once(Return(4)); assert_eq!(6, mock.fuu()); assert_eq!(4, mock.fuu()); }