RE: Don't use Mocking libraries
Great write up. I laughed at this:
You should not mock someone else's class (a good life rule in general),
I generally prefer functional tests over unit tests with mocking and such. So many people flip out and say, “but, but, what if you database dies or something else breaks due to the combination of everything together?” Etc. In my experience that’s usually the kind of thing that happens in production and code with high unit test coverage can’t handle it, and the devs have little experience recovering from it. Functional tests (from request, all the way to the db and back again to response) seem to give me the most bang for the buck and can be really helpful when refactoring something internal to ensure it didn’t have some larger consequence.