Guys, super quick question. Any idea why this test...
# rx
f
Guys, super quick question. Any idea why this test is not passing? I would expect
firstOrError
to throw error if subject has no values.
Copy code
@Test
    fun `assert tha behaviour subject behaves like i would expect to behave`() {
        BehaviorSubject.create<Boolean>()
                .firstOrError()
                .test()
                .assertComplete()
    }
s
is it failing on assertComplete()? doesn’t look like that subject would ever complete
f
It should be error actually, but the issue is with
firstOrError
-> i have troubles with understanding why it’s NOT throwing an error when there are no items
s
the subject has to complete first since firstOrError just creates a single that’s waiting for a terminal event like onNext, onComplete, onError
f
Any idea how I can map that behaviour subject easily to get expected (expected for me) result which is error when there are no elements?
s
call onComplete