Skip to content

Instantly share code, notes, and snippets.

@leviwilson
Created March 18, 2013 14:58
Show Gist options
  • Save leviwilson/5187748 to your computer and use it in GitHub Desktop.
Save leviwilson/5187748 to your computer and use it in GitHub Desktop.
Custom app path in Robolectric 2.0
public CustomTestRunner(Class<?> testClass) throws InitializationError {
super(RobolectricContext.bootstrap(CustomTestRunner.class, testClass, new Factory() {
@Override
public RobolectricContext create() {
return new RobolectricContext() {
@Override
protected AndroidManifest createAppManifest() {
return new AndroidManifest(new File("../YourAppDirectory"));
}
};
}
}));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment