Skip to content

How to make multiple mock types with different TypeId when mocking a trait #392

Answered by asomers
richardzone asked this question in Questions
Discussion options

You must be logged in to vote

Sure. It's easy. You can only use automock once, but you can use mock! as much as you like.

#[automock]
trait Task{}
mock!{
    pub OtherTask{}
    impl Task for OtherTask{}
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by richardzone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants