hitherejoe / Bourbon

An MVP Dribbble client for Android Mobile, Tablet, Wear and TV.
https://medium.com/exploring-android/introducing-bourbon-dribbble-android-mvp-and-a-common-code-module-1d332a4028b5#.d83w4b7ol
1.12k stars 137 forks source link

Benefit of using RxSchedulersOverrideRule instead of toBlocking #9

Open akoufa opened 8 years ago

akoufa commented 8 years ago

I would like to know what is the benefit of using the RxSchedulersOverrideRule TestRule instead of the toBlocking? Is it only to avoid attaching toBlocking to every call in every test method? Or the possibility to run the tests on the JVM avoiding the RxAndroid Scheduler?

akoufa commented 8 years ago

I saw that you can bypass the package private without needing to rely on reflection using this trick shown at this link http://fedepaol.github.io/blog/2015/09/13/testing-rxjava-observables-subscriptions/ . This guy just creates a class with package name "rx.plugins" and delegates the method call to the now accessible package private method reset().