-
-
Notifications
You must be signed in to change notification settings - Fork 288
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
[RFC] HaveEach
matcher
#520
Comments
hey @thediveo this sounds like a useful addition. How about
And paves the way for
thoughts? |
wouldn't |
um... (awkward silence)... yes |
Pondering again on |
Yeah, you're right. |
- implements new HaveEachMatcher including unit tests - wires up HaveEach with HaveEachMatcher - adds HaveEach documentation
In the hope that I didn't overlooked this functionality in the existing matchers: I would like to propose an
Each
matcher that checks that all elements of an array or slice match the specified value/matcher. Similar for maps,Each
checks that all map values match the specified value/matcher.border case:
Expect([]string{}).To(Each(Equal("")))
is expected to succeed. If not desired, use this idiom:I can work on a PR if you like and after some clean-up and adding the necessary tests 😁.
P.S.: still struggling with the language semantics of
Each
andEvery
, but then Javascript usedforEach(...)
and notforEvery(...)
😉The text was updated successfully, but these errors were encountered: