diff options
author | Samuel Tardieu <sam@rfc1149.net> | 2015-01-06 11:04:20 +0100 |
---|---|---|
committer | Samuel Tardieu <sam@rfc1149.net> | 2015-01-06 11:05:37 +0100 |
commit | 5dff962101d1bc4aa26f4f18b381162e47bcea22 (patch) | |
tree | ba906a043b8b72642f7b41981b8cf6251c140a90 /tests/src/cgeo/geocaching | |
parent | 8fdb2c5067c4bcb0c73568b06be2156a42ef23d2 (diff) | |
download | cgeo-5dff962101d1bc4aa26f4f18b381162e47bcea22.zip cgeo-5dff962101d1bc4aa26f4f18b381162e47bcea22.tar.gz cgeo-5dff962101d1bc4aa26f4f18b381162e47bcea22.tar.bz2 |
Alternate workaround for missing method in tests
This one has the advantage of not requiring any extra code in the
application itself.
Diffstat (limited to 'tests/src/cgeo/geocaching')
-rw-r--r-- | tests/src/cgeo/geocaching/utils/RxUtilsTest.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/src/cgeo/geocaching/utils/RxUtilsTest.java b/tests/src/cgeo/geocaching/utils/RxUtilsTest.java index 5259998..2487184 100644 --- a/tests/src/cgeo/geocaching/utils/RxUtilsTest.java +++ b/tests/src/cgeo/geocaching/utils/RxUtilsTest.java @@ -6,13 +6,23 @@ import rx.Observable; import rx.Subscription; import rx.functions.Func1; import rx.subjects.PublishSubject; +import rx.subjects.ReplaySubject; import android.test.AndroidTestCase; public class RxUtilsTest extends AndroidTestCase { + // Observable.range(int, int) is not kept in the application by proguard. Use an explicit range here. + private static final ReplaySubject<Integer> range = ReplaySubject.createWithSize(10); + static { + for (int i = 1; i <= 10; i++) { + range.onNext(i); + } + range.onCompleted(); + } + public static void testTakeUntil() { - final Observable<Integer> observable = Observable.range(1, 10).lift(RxUtils.operatorTakeUntil(new Func1<Integer, Boolean>() { + final Observable<Integer> observable = range.lift(RxUtils.operatorTakeUntil(new Func1<Integer, Boolean>() { @Override public Boolean call(final Integer value) { return value > 6; |