Skip to content

support asserting JSON types other than objects (fixes #16) #17

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

Merged
merged 1 commit into from
Oct 24, 2017

Conversation

dvic
Copy link
Contributor

@dvic dvic commented Oct 23, 2017

The JSON matching is is adjusted to compared marshalled values instead of bytes because the order of JSON object keys is non deterministic and therefore can cause comparisons to fail.

@dvic dvic force-pushed the json-generic-assertion branch from 2c0e5ea to a914fad Compare October 23, 2017 17:34
@coveralls
Copy link

coveralls commented Oct 23, 2017

Coverage Status

Coverage remained the same at 87.105% when pulling a914fad on dvic:json-generic-assertion into ea5c148 on h2non:master.

@dvic
Copy link
Contributor Author

dvic commented Oct 23, 2017

Can't believe i'm running into this golang/go#14493

The JSON matching is is adjusted to compared marshalled values instead
of bytes because the order of JSON object keys is non deterministic and
therefore can cause comparisons to fail.
@dvic dvic force-pushed the json-generic-assertion branch from a914fad to 3591283 Compare October 23, 2017 17:59
@coveralls
Copy link

coveralls commented Oct 23, 2017

Coverage Status

Coverage remained the same at 87.105% when pulling 3591283 on dvic:json-generic-assertion into ea5c148 on h2non:master.

@dvic
Copy link
Contributor Author

dvic commented Oct 23, 2017

Fixed the issue with go 1.7 by taking a pointer to json.RawMessage before marshalling.

@h2non h2non self-requested a review October 24, 2017 06:32
@h2non h2non merged commit ac7b6af into h2non:master Oct 24, 2017
@h2non
Copy link
Owner

h2non commented Oct 24, 2017

Thank you! Will bump the major version since this introduce breaking changes.

@h2non
Copy link
Owner

h2non commented Oct 24, 2017

New version is out! Thanks for the PR.

@dvic
Copy link
Contributor Author

dvic commented Oct 24, 2017

Cool, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants