Add explanatory comment to test

This commit is contained in:
Kyriakos Tharrouniatis 2020-02-17 11:09:09 +00:00
parent 9a27a81670
commit 58a71d8d07

View File

@ -334,10 +334,14 @@ class ObservablesTests {
assertEquals(2, heartBeatOnError)
}
/**
* In this test FlowSafeSubscriber throws an OnNextFailedException which is a OnErrorNotImplementedException.
* Because its underlying subscriber is not an ActionSubscriber, it will not be considered as a leaf FlowSafeSubscriber.
*/
@Test
fun `throwing FlowSafeSubscriber at onNext will wrap with a Rx OnErrorNotImplementedException`() {
val flowSafeSubscriber = FlowSafeSubscriber<Int>(Subscribers.create { throw IllegalStateException() })
assertFailsWith<OnErrorNotImplementedException> {
assertFailsWith<OnErrorNotImplementedException> { // actually fails with an OnNextFailedException
flowSafeSubscriber.onNext(1)
}
}