Closed Tarcontar closed 7 months ago
Found it in the examples:
pub trait A {
fn foo(&self);
}
pub trait B: A {
fn bar(&self);
}
mock! {
// Structure to mock
C {}
// First trait to implement on C
impl A for C {
fn foo(&self);
}
// Second trait to implement on C
impl B for C {
fn bar(&self);
}
}
But would be nice if that was also supported by automock!
In fact, I have a plan for how to do just that! I have a partial implementation too, but it isn't ready yet. Still a few corner cases to take care of. See https://github.com/asomers/mockall/discussions/539 .
Hi, I want to mock a trait that is composed of two other traits like so:
Result in the error: "the trait bound '..MockAB: B' is not satisfied the trait B is implemented for MockB"
How would I do that? Thanks!