-
Notifications
You must be signed in to change notification settings - Fork 6
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
Matchers: has.ElementsWith and has.StructWithValues #1
Conversation
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.
Thanks for this, these matchers look good.
In addition to my comments, please take a look at the test coverage - coveralls seems to be complaining that there is some missing coverage somewhere.
Please address my concerns when you get a chance and I will merge your PR.
Thanks for your Feedback! I am wondering why coveralls does not track that last line. I checked it locally and this test case should cover the missing line: https://github.com/corbym/gocrest/pull/1/files#diff-1a13e117c42f75f290b07b9587f7401c2f91a32980298f6e0bc547de98865e51R817 🤔 Is there a possiblity to call coveralls locally? |
One thing I want to get mentioned: |
I think coveralls is having a bit of a paddy. I will merge your code and then check out what is happening from there. |
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.
Looking good.. just one last thing I think!
I have opened an issue for this. It will be esp. useful when allOf and anyOf or the variadic parametered matchers are called. |
I found the reason for this: the test was assigning the actual string to an interface{} type and that was Panicking in the for loop rather than the default method. This has been fixed. |
I implemented two new matchers:
has.ElementsWith
: Checks wether each element of an array/slice matches all expectationshas.StructWithValues
: Allows to check single struct fieldsCan be combined in a way that now we can check if f.e.:
has structs that have an
id
field with the prefixsomeId