Should it really behave like that? ```@Test fun sh...
# rx
k
Should it really behave like that?
Copy code
@Test fun shouldBlowYourMind() {
    Observable.empty<Unit>().test().assertEmpty()
}
java.lang.AssertionError: Completed! (latch = 0, values = 0, errors = 0, completions = 1)
a
karolkowalski: Looks like a bug or incomplete documentation
Copy code
public final U assertEmpty() {
        return assertSubscribed()
                .assertNoValues()
                .assertNoErrors()
                .assertNotComplete();
    }
File an issue I guess, either javadoc or
assertNotComplete()
should be fixed
b
In the javadocs for assertEmpty() says "Assert that the TestObserver/TestSubscriber/TestSubscriber has received a Disposable but no other events."
And it is receiving a Complete Event, so it's being consistent with the documentation
a
Well, it’s still kinda strange to have method named
assertEmpty()
that fails on
Observable.empty()
b
Well, I agree that the name could lead to confusion. Maybe a rename to
assertNoEvents()
could avoid confusion