Closed danielbprice closed 6 years ago
(also the message is wrong in this case)
Ohhhhhh dang. That's a really interesting case where you're using the -
argument to indicate that this should write to stdout.
I don't think that we ever stopped to think about the interaction of those two features, and I'm really glad you caught that.
I believe this will be fixed soon - currently waiting for it to go through CI.
Would you mind checking this out again @danielbprice ? I believe this should be fixed now. Sorry for the long delay here, I was on vacation and there aren't any other maintainers of counterfeiter at the moment.
With respect to your comment about comparing Counterfeiter to mockery and mockgen, I find it pretty cool that you found counterfeiter considering that it's a small labor of love without much real support from the community or any marketing or PR to raise awareness of it.
I was using mockgen recently on a client project and found it to have a really nice API for writing assertions and stubs (mock.Expect().MyMethod("with", "args").Return("some value")
) but that its CLI interface is really painful to use. Perhaps that's just because I've been using counterfeiter for years, but I find that the equivalent of a standard counterfeiter command counterfeiter . XYZClient
takes quite a lot more with mockgen. If you're using go:generate
style comments, it makes it really hard to scan and see that it's been done correctly.
If you're using ginkgo with counterfeiter, I recommend checking out http://github.com/tjarratt/gcounterfeiter, since I wrote that to make writing assertions quite nicer.
In the future, I'm looking at adding a more pleasant interface inspired by mockgen, but given that I only work on this project in my very limited free time, or when my work allows me to work on open source work, I really can't commit to when that will happen...
Looks good to me
I'm evaluating Counterfeiter as compared to mockery, mockgen, etc. Something I noticed is that this invocation:
Produces a file ending with a diagnostic message:
Probably this message (and any other similar) should go to
stderr
instead.