-
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: TestSubscriber & TestObserver add assertValue(Predicate) #4607
2.x: TestSubscriber & TestObserver add assertValue(Predicate) #4607
Conversation
|
||
for (T value : values) { | ||
try { | ||
if (valuePredicate.test(value)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unnecessary, just test values.get(0) and then report if s > 1 besides.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah thought of that too I just took the same implementation as assertError(predicate). I'll change it there too, ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't change assertError.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the first error may come from the lack of onSubscribe call or some other unexpected exception. Knowing that the exception is there but not the only one is different from expecting exactly 1 element but then getting n.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that makes sense. Thanks David for the explanation
No description provided.