-
Notifications
You must be signed in to change notification settings - Fork 15
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
more refactor to allow for additional capabilities #79
base: master
Are you sure you want to change the base?
Conversation
haveHeaderInternal(headers, _.missing.isEmpty, | ||
res => s"Could not find header [${res.missing.map(_._1).mkString(", ")}] but found those: [${res.identical.map(_._1).mkString(", ")}].") | ||
haveHeaderInternal(headers, | ||
{ case res if res.missing.nonEmpty || res.contentDiff.nonEmpty => s"Could not find header [${res.missing.names}] but found those: [${res.identical.names}]." } |
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.
@noam-almog I actually think this is confusing to only show the identical names.
there could be a typo and the header name mismatch for some reason. in a way i think it might be more beneficial to explicitly say what was the same, what was missing, what was extra.
it could even be wiser to make the same error message for all those 3 matchers, since it would always give the same message - no surprises.
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.
can you show an example of what is confusing ? do you want to remove the identical names section of the message ?
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.
for example, I expect (ABC -> "hi") instead the response came back with (ACB -> "hi"). it will show:
Could not find header [ABC] but found those: [].
which does not really help me identify the issue, don't you think?
As I said, I think it would be best to always give the entire information:
Found matching headers [...]. Found Matching headers with content difference [...]. missing headers are [..]. extra headers are [...].
wording is up to you. also, if it's too verbose we can omit sections that are empty.
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.
first, the first message displays an empty list which is a bug and needs to be fix anyhow.
as for your comments, looks better, pay attention when you present those errors show them with the order someone will be expect to see them. if you throw just large amount of text to the dev it will be too much.
i would go with:
Found Matching headers with content difference [...]
missing headers are [..]
extra headers are [...]
Matching headers [...]. . .
3a47238
to
90aac23
Compare
this is a continuation on #78.
once the previous one is merged, we can merge this as well.