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 1
1
dependencies {
2
2
compile project(' :kotlinx-coroutines-reactive' )
3
- compile ' io.reactivex.rxjava2:rxjava:2.0.6 '
3
+ compile ' io.reactivex.rxjava2:rxjava:2.1.9 '
4
4
}
5
5
6
6
tasks. withType(dokka. getClass()) {
Original file line number Diff line number Diff line change 16
16
17
17
package kotlinx.coroutines.experimental.rx2
18
18
19
- import io.reactivex.Maybe
20
- import io.reactivex.Observable
21
- import io.reactivex.Single
19
+ import io.reactivex.*
22
20
23
21
fun <T > checkSingleValue (
24
22
observable : Observable <T >,
@@ -33,7 +31,8 @@ fun checkErroneous(
33
31
checker : (Throwable ) -> Unit
34
32
) {
35
33
val singleNotification = observable.materialize().blockingSingle()
36
- checker(singleNotification.error)
34
+ val error = singleNotification.error ? : error(" Excepted error" )
35
+ checker(error)
37
36
}
38
37
39
38
fun <T > checkSingleValue (
Original file line number Diff line number Diff line change 16
16
17
17
package kotlinx.coroutines.experimental.rx2
18
18
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.*
26
24
27
25
/* *
28
26
* Tests emitting single item with [rxObservable].
@@ -73,7 +71,7 @@ class ObservableSingleTest {
73
71
}
74
72
75
73
checkErroneous(observable) {
76
- assert (it is IllegalArgumentException )
74
+ assertTrue (it is IllegalArgumentException )
77
75
}
78
76
}
79
77
@@ -187,7 +185,7 @@ class ObservableSingleTest {
187
185
}
188
186
189
187
checkErroneous(observable) {
190
- assert (it is IllegalStateException )
188
+ assertTrue (it is IllegalStateException )
191
189
assertEquals(" OK" , it.message)
192
190
}
193
191
}
You can’t perform that action at this time.
0 commit comments