Hacker News new | ask | show | jobs
by sayan51 1819 days ago
In my projects things are arranged in terms of class, and dependencies are injected to constructor using dependency injection. Then the requirements of mocking the dependencies during unit tests bolis down to mocking parts or whole of the implementation as well as recording those method cqlls. The spy implementation is based on that philosophy and is therefore simple, straightforward and tiny.