Replies: 1 comment 3 replies
-
No, you're doing it the best way. Technically, you don't even need to do anything, because a method with no expectations will always panic when called. But doing it this way and using |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an object that I want to make sure it doesn't call methods on the mock in some cases. Basically, I have a trait for different backing stores for a small bit of data. I want to make sure that the data is lazily populated, so I want to make sure that certain actions have no calls to the mocked trait.
My current try looks like this in the test code:
I guess I could manually impl a method on the mock type that sets this up the expectations and use that, but I was wondering if there was something built-in that I could use.
I have looked around the api, and it looks like there is not a built-in way to do that. I just wanted to ask here to see if I missed something.
Beta Was this translation helpful? Give feedback.
All reactions