Skip to content

Visibility with mock! #295

Answered by asomers
jprenaudet asked this question in Questions
Jun 22, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

When you use mock!, just type the name of the struct that you're trying to mock. Don't add a leading Mock; Mockall will do that for you. So do it like this:

    mock! {
        pub MyManuelTrait {}
        impl MyManuelTrait for MyManuelTrait {
            fn test(&self) -> i32;
        }
    }

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jprenaudet
Comment options

Answer selected by jprenaudet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #294 on June 22, 2021 13:32.