-
Notifications
You must be signed in to change notification settings - Fork 609
STUBS method #24
Comments
STUBS is just EXPECT + AnyTimes, is it not? |
It's more like EXPECTS.Call(gomock.Any()).Anytimes() |
In fact, the above is pretty much what I'm using now, but IMHO, STUBS would make tests clearer. |
Yeah, that's what I meant. So it'd be just syntactic sugar for that? |
Yes, no arg checking, no checking of number of calls. |
And to be clear, yes, it's syntactic sugar. |
My initial instinct is to say no. I don't want to complicate the API for something that is relatively simple to do already. People have been using gomock to produce stubs for years without issue. But I'll have a think about it. |
Ok, I respect that. I just want to add that I think it would make scanning through tests easier and clearer if STUBS was available, and people coming from other mocking frameworks might miss it like I do. I'll of course defer to your decision when you've thought through it. |
I think I'd prefer to leave things as they are. Thanks anyway. |
Ok, now that we've got the *Times thing out of the way, the other thing I really miss is a STUBS method. I'd like to discuss this first with you before I go and try to contribute it, maybe cut down on the back-and-forth a bit.
When I've used other mocking frameworks, I use
Would you be open to that addition?
The text was updated successfully, but these errors were encountered: