You don't inject for tests
11–14 of 14 posts
Re: You don't inject for tests
#12I test to verify that my code works.. Why would unit test show me where object orientation breaks down?
Re: You don't inject for tests
#13In a dynamic language, unit testing is a bad reason to use dependency injection. There are lots of valid reasons to use it. But you don't need it for unit testing.
Returning to DHH's example, if you just want to get the current time in Ruby code, just get it. You can use the dynamic nature of the language to stub that out and unit test it. But you don't need to use dependency injection to enable that. And you really don't need to use a heavy framework.
If you have a different reason to use dependency injection, though, by all means go ahead.
Re: You don't inject for tests
#14I test to verify that my code works.. Why would unit test show me where object orientation breaks down?
When things are hard to unit test, it might be a smell that there is something wrong with your OOP code.