Skip to content

Instantly share code, notes, and snippets.

@ygorbarboza
Created February 29, 2016 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ygorbarboza/a2a559d53c13c7327b20 to your computer and use it in GitHub Desktop.
Save ygorbarboza/a2a559d53c13c7327b20 to your computer and use it in GitHub Desktop.
public class RxJavaTestRunner extends MockitoJUnitRunner {
// private static final TestScheduler SCHEDULER = new TestScheduler();
public RxJavaTestRunner(Class<?> klass) throws InvocationTargetException {
super(klass);
RxAndroidPlugins.getInstance().reset();
RxAndroidPlugins.getInstance().registerSchedulersHook(new RxAndroidSchedulersHook() {
@Override
public Scheduler getMainThreadScheduler() {
return Schedulers.testScheduler();
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment