Skip to content
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

be_json_eql(:null) is not intuitive #23

Closed
crimsonknave opened this issue Feb 27, 2012 · 2 comments
Closed

be_json_eql(:null) is not intuitive #23

crimsonknave opened this issue Feb 27, 2012 · 2 comments

Comments

@crimsonknave
Copy link

It seems very counter intuitive to me that to check if the json is null I need to pass the string null and can't pass the nil object. I'm pretty sure I was able to do this in previous versions. I'd love to see either an example in the readme if that is the desired behavior.

@laserlemon
Copy link
Contributor

The purpose of the JSON matchers is to compare JSON to other JSON. If you want to assert the Ruby value at a path, you can use the json_spec helpers like so:

parse_json(your_json, your_path).should == your_ruby

Does that help?

@crimsonknave
Copy link
Author

Ok, that makes sense. I'll just update my tests to be like:
it { should be_json_eql(object.to_json) }

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

No branches or pull requests

2 participants