-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.x: BaseObserver.assertOnlyValues(T...) #5555
Comments
assertResult will eventually fail so assertValues was generally enough. When there is a bug, you can apply the other methods on a case by case basis. |
Although |
You can write this utility method in a class: public static <T, U extends BaseTestConsumer<T>> assertValuesOnly(U ts, T... values) {
return ts.assertValues(values).assertNoErrors().assertNotComplete().assertSubscribed();
} And IntelliJ will happily staticly import it. |
I tend to agree with @vanniktech on this feature-request.
It's usually too late because code was shipped…
For sure, I'm also pretty sure @vanniktech uses Kotlin so he could add extension function. Not a fan of naming though, but I see the pattern, |
That's what I'm doing right now. However I still think a lot of other people could benefit from this and the cost of adding this is really low.
Open for any better name. |
Okay, let's add it. I'd name it |
I'd like to introduce
assertOnlyValues
to theBaseObserver
. It's the counterpart toassertResult(T...)
which does almost the same except for the fact that the type hasn't completed yet.I'm open if anyone has a better function name. Internally it'd delegate to:
The text was updated successfully, but these errors were encountered: