On Jun 19, 3:06 pm, Peter Niederwieser <
pnied...@gmail.com> wrote:
> spock-guice starts one or more Guice modules before executing a spec class, and shuts them down afterwards. Services can be injected into specs with the usual Guice annotations. To see how it works, have a look at the specs for spock-guice, for examplehttps://
github.com/spockframework/spock/blob/groovy-1.8/spock-guice/s...
>
I like it!
> For unit tests you shouldn't use Guice at all. Just instantiate A and pass it a mock for B. As soon as you are using Guice, your tests become integration tests.
In this case B is being injected into a private field rather than via
the constructor. Perhaps that's a design flaw.