diff options
Diffstat (limited to 'macros/src/lib.rs')
-rw-r--r-- | macros/src/lib.rs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/macros/src/lib.rs b/macros/src/lib.rs index 36c6ad7..8106a8c 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -34,11 +34,20 @@ pub fn mock(input_stream: TokenStream) -> TokenStream }) .collect::<Vec<_>>(); - let mock = Mock::new(mock_ident.clone(), input.mocked_trait, &method_items); + let mock = Mock::new( + mock_ident.clone(), + input.mocked_trait, + &method_items, + input.item_impl.generics.clone(), + ); - let expectations = method_items - .iter() - .map(|item_method| Expectation::new(&mock_ident, item_method)); + let expectations = method_items.iter().map(|item_method| { + Expectation::new( + &mock_ident, + item_method, + input.item_impl.generics.params.clone(), + ) + }); quote! { mod #mock_mod_ident { |