logoalt Hacker News

BlackFlytoday at 10:41 AM0 repliesview on HN

I cannot put my finger on it exactly either. I also often find the mocking DSL the better choice in tests.

But when there are many tests where I instantiate a test fixture and return it from a mock when the method is called, I start to think that an in memory stub would have been less code duplication and boilerplate... When some code is refactored to use findByName instead of findById and a ton of tests fail because the mock knows too much implementation detail then I know it should have been an in memory stub implementation all along.