File tree Expand file tree Collapse file tree 3 files changed +11
-14
lines changed
reactive/kotlinx-coroutines-rx2
src/test/kotlin/kotlinx/coroutines/experimental/rx2 Expand file tree Collapse file tree 3 files changed +11
-14
lines changed Original file line number Diff line number Diff line change 11dependencies {
22 compile project(' :kotlinx-coroutines-reactive' )
3- compile ' io.reactivex.rxjava2:rxjava:2.0.6 '
3+ compile ' io.reactivex.rxjava2:rxjava:2.1.9 '
44}
55
66tasks. withType(dokka. getClass()) {
Original file line number Diff line number Diff line change 1616
1717package kotlinx.coroutines.experimental.rx2
1818
19- import io.reactivex.Maybe
20- import io.reactivex.Observable
21- import io.reactivex.Single
19+ import io.reactivex.*
2220
2321fun <T > checkSingleValue (
2422 observable : Observable <T >,
@@ -33,7 +31,8 @@ fun checkErroneous(
3331 checker : (Throwable ) -> Unit
3432) {
3533 val singleNotification = observable.materialize().blockingSingle()
36- checker(singleNotification.error)
34+ val error = singleNotification.error ? : error(" Excepted error" )
35+ checker(error)
3736}
3837
3938fun <T > checkSingleValue (
Original file line number Diff line number Diff line change 1616
1717package kotlinx.coroutines.experimental.rx2
1818
19- import io.reactivex.Observable
20- import kotlinx.coroutines.experimental.CommonPool
21- import kotlinx.coroutines.experimental.runBlocking
22- import org.junit.Assert.assertEquals
23- import org.junit.Assert.fail
24- import org.junit.Test
25- import java.util.concurrent.TimeUnit
19+ import io.reactivex.*
20+ import kotlinx.coroutines.experimental.*
21+ import org.junit.*
22+ import org.junit.Assert.*
23+ import java.util.concurrent.*
2624
2725/* *
2826 * Tests emitting single item with [rxObservable].
@@ -73,7 +71,7 @@ class ObservableSingleTest {
7371 }
7472
7573 checkErroneous(observable) {
76- assert (it is IllegalArgumentException )
74+ assertTrue (it is IllegalArgumentException )
7775 }
7876 }
7977
@@ -187,7 +185,7 @@ class ObservableSingleTest {
187185 }
188186
189187 checkErroneous(observable) {
190- assert (it is IllegalStateException )
188+ assertTrue (it is IllegalStateException )
191189 assertEquals(" OK" , it.message)
192190 }
193191 }
You can’t perform that action at this time.
0 commit comments