use of net.rdrei.android.scdl2.guice.SCDLModule in project scdl by passy.
the class TestHelper method overridenInjector.
public static void overridenInjector(Object instance, AbstractModule module) {
final Application app = Robolectric.application;
// Allow overriding of integrated classes like Activity
Module moduleOverride = Modules.override(RoboGuice.newDefaultRoboModule(app)).with(module);
// Also allow overriding custom bindings like URLWrapper
moduleOverride = Modules.override(new SCDLModule()).with(moduleOverride);
RoboGuice.setBaseApplicationInjector(app, RoboGuice.DEFAULT_STAGE, moduleOverride);
final Injector injector = TestHelper.getInjector();
injector.injectMembers(instance);
}
Aggregations