3 ms·
When to Mock
- dev360 13y agoThis was a great read. I find this approach to be the path of least resistance with languages like C#, but for Python or Ruby, I always find myself using a mock framework. That overhead in structure (classes, interfaces etc.) feels like it adds very little in dynamic languages and generally the mock syntax can be quite readable (notably RSpec mocks).
- platz 13y agoI must admit I work in C# and with the static experience, but I'd be nervous to use mocks when the implementation might not match the api of the mock anymore, because you don't get errors if the thing your mocking changes.