re: Don't Mock What You Don't Own VIEW POST


Thanks for the comment.

You have a very good point. I've introduced a test that is tightly coupled to CarrierWave here, which made it kind of integration tests (which I didn't originally intend to do).

So here I've described that mocking would be even worse idea.

But I agree that the better solution would be to have a wrapper.

This article describes not so recent events, but I'll research the possibility of wrapping CarrierWave and ActiveRecord for my future projects.

I agree with Paweł.
From my experience, avoiding mocks on some tests turns them into integration tests and that's not always the goal when doing TDD.
I do like the idea of having wrappers, but that doesn't reduce the need for mocking completely when dealing with 3rd party libs.

Great article!

code of conduct - report abuse