Created
October 6, 2019 17:20
-
-
Save talosdev/42fa7b09585622a65456cd4bbdffe7fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Throws(UndeliverableException::class) | |
@Test | |
fun `observable that throws error after emitting an item to single with firstOrError`() { | |
RxJavaPlugins.setErrorHandler { System.err.println("An unhandled exception was caught: $it") } | |
val observable = Observable.create<Int> { emitter -> | |
emitter.onNext(1) | |
emitter.onNext(2) | |
emitter.onError(RuntimeException("Exception while emitting Ints")) | |
} | |
assertObservableToSingle(observable, { firstOrError()}) { | |
assertComplete() | |
assertValue(1) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment