Skip to content

Instantly share code, notes, and snippets.

@davespanton
Created March 15, 2012 22:48
Show Gist options
  • Save davespanton/2047448 to your computer and use it in GitHub Desktop.
Save davespanton/2047448 to your computer and use it in GitHub Desktop.
New prepareTest method
@Override
public void prepareTest(Object test) {
NutbarTestModule module = new NutbarTestModule();
RoboGuice.setBaseApplicationInjector(Robolectric.application, RoboGuice.DEFAULT_STAGE, Modules.override(RoboGuice.newDefaultRoboModule(Robolectric.application)).with(module));
Injector injector = RoboGuice.getInjector(Robolectric.application.getApplicationContext());
injector.injectMembers(test);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment