Not mocking 3rd party is done in integration or orchestration testing. Not your unit tests.
Not mocking 3rd party is done in integration or orchestration testing. Not your unit tests.
Please search for “If you’re anything like me, that makes no sense! What else am I supposed to mock?” and read with an open mind.
Even if you want to make the writing a journey that arrives at a conclusion rather than a thesis-first argument, the presentation immediately being scattered across a bunch of embedded block quotes and long asides (your disclaimer) invites readers to lose the path, give up, and just make assumptions about the remainder.
And what always happens on the internet when people do that? Comments that miss the point and confuse everybody else about what you were saying. You're right that the other commenter could have been more responsible, but odds are that someone was going to post a comment like even if it didn't happen to be them.
That's a fair point. I guess it comes in a bit differently in C++ land, because the "you shouldn't" comes into what you decide to allow to be injectable (e.g. if your constructor only accepts the third party object type, you're not gonna be able to mock it). As such, you gotta keep the principle in mind when designing your objects. That said, you're definitely right, it smells like that fallacy
On the other hand, in Ruby and Python it's pretty trivial to monkey patch and magic mock
I’ve found numerous bugs in infernal apis by being one of the only teams to prefer or even use integration tests.