1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// vim: tw=80 #![deny(warnings)] use mockall::*; mock! { Foo { fn bar<T: 'static>(x: T); } } #[test] fn returning() { let ctx = MockFoo::bar_context(); ctx.expect::<i16>().returning(|_| ()); MockFoo::bar(0i16) }