"Expected Included JSON" RSpec Exception doesn't have any more info #45

Closed
rangerscience opened this Issue Jun 28, 2013 · 8 comments

Comments

Projects
None yet
4 participants
@rangerscience
$ step 'the JSON response should include:', JSON.pretty_generate(data)
*** RSpec::Expectations::ExpectationNotMetError Exception: Expected included JSON

Whereas:

$ step 'the JSON response should be:', JSON.pretty_generate(data)
*** RSpec::Expectations::ExpectationNotMetError Exception: Expected equivalent JSON
Diff:
@@ -2,19 +2,7 @@
(diff)

Ruby 2 / Rails 4 / JSON Spec 1.1.1

@laserlemon

This comment has been minimized.

Show comment Hide comment
@laserlemon

laserlemon Jun 28, 2013

Contributor

Comfortable with a pull request?

Contributor

laserlemon commented Jun 28, 2013

Comfortable with a pull request?

@rangerscience

This comment has been minimized.

Show comment Hide comment
@rangerscience

rangerscience Jun 28, 2013

Maybe? Do you mean, "make my own fork and accept a pull request from you"?

Maybe? Do you mean, "make my own fork and accept a pull request from you"?

@laserlemon

This comment has been minimized.

Show comment Hide comment
@laserlemon

laserlemon Jun 28, 2013

Contributor

I mean please feel free to fork the repo, make the change (with tests) and submit a pull request.

Contributor

laserlemon commented Jun 28, 2013

I mean please feel free to fork the repo, make the change (with tests) and submit a pull request.

@rangerscience

This comment has been minimized.

Show comment Hide comment
@rangerscience

rangerscience Jun 28, 2013

I could make a go of it.

I could make a go of it.

@rangerscience

This comment has been minimized.

Show comment Hide comment
@rangerscience

rangerscience Jun 28, 2013

The lazy fix is pretty simple - just enable diffing for the include matcher, but it breaks a lot of tests and it's the same diff you'd get with be. Dunno yet if that's the best.

rangerscience/json_spec@1e36fc6

The lazy fix is pretty simple - just enable diffing for the include matcher, but it breaks a lot of tests and it's the same diff you'd get with be. Dunno yet if that's the best.

rangerscience/json_spec@1e36fc6

@rangerscience

This comment has been minimized.

Show comment Hide comment
@rangerscience

rangerscience Jun 29, 2013

...course, the tests fail because it breaks things that way. Fixed; just provide what's needed for the diff (diffable, expected, actual), but don't override any of the existing functionality. I think the full diff works - rather than just showing what's expected and missing - since it provides context. I'll chuck you a pull request, and if you want some more in the way of testing/functionality, let me know?

...course, the tests fail because it breaks things that way. Fixed; just provide what's needed for the diff (diffable, expected, actual), but don't override any of the existing functionality. I think the full diff works - rather than just showing what's expected and missing - since it provides context. I'll chuck you a pull request, and if you want some more in the way of testing/functionality, let me know?

@marshallshen

This comment has been minimized.

Show comment Hide comment
@marshallshen

marshallshen Jul 20, 2013

I submitted PR related to this issue, but closed it since it wasn't reviewed..
#42

Thoughts?

I submitted PR related to this issue, but closed it since it wasn't reviewed..
#42

Thoughts?

@shekibobo

This comment has been minimized.

Show comment Hide comment
@shekibobo

shekibobo May 3, 2017

Owner

Closed via #53

Owner

shekibobo commented May 3, 2017

Closed via #53

@shekibobo shekibobo closed this May 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment