How do I use mockall in a struct that derives Clone? #308
Answered
by
asomers
augustocdias
asked this question in
Questions
-
So I have a struct like this #[derive(Clone)]
pub struct MyStruct {
...
}
#[automock]
impl MyStruct{
} I use the And the function I wanna test at some point calls |
Beta Was this translation helpful? Give feedback.
Answered by
asomers
Jul 7, 2021
Replies: 1 comment 5 replies
-
The way you specified it, Mockall doesn't know that mock! {
MyStruct {}
impl Clone for MyStruct {
fn clone(&self) -> Self;
}
} |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
augustocdias
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The way you specified it, Mockall doesn't know that
MyStruct
is supposed to beClone
. Instead, do it like this: