Skip to content
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

Merged
merged 2 commits into from
Sep 26, 2016
Merged

2.x: TestSubscriber & TestObserver add assertValue(Predicate) #4607

merged 2 commits into from
Sep 26, 2016

Conversation

vanniktech
Copy link
Collaborator

No description provided.


for (T value : values) {
try {
if (valuePredicate.test(value)) {
Copy link
Member

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.

Copy link
Collaborator Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't change assertError.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why?

Copy link
Member

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.

Copy link
Collaborator Author

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

@akarnokd akarnokd added this to the 2.0 RC4 milestone Sep 26, 2016
@akarnokd akarnokd merged commit 4f0791f into ReactiveX:2.x Sep 26, 2016
@vanniktech vanniktech deleted the 2.x_add_assert_value_predicate branch September 26, 2016 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants