GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
I currently have a setup that had a last_json method already implemented before migrating to json_spec for cucumber testing. The method already returned a parsed JSON, which is not compatible since json_spec wants to parse it again from a string.
I committed a change to only parse the JSON in case it's a string (else return the given option). I can't see a reason why last_json should only be the last_response.body string (or similar) and not already a Hash/Array.
Would that be something you could merge into the main branch?
Helpers#parse_json to not parse unless a String
Thanks for your work, Rudolf. I like the idea but I would like to see at least another higher level test for this. Because there's been no contract that last_json will always be run through parse_json (although that seems to be the case right now), we need to ensure that each of the matchers work properly when fed Ruby rather than JSON. Make sense? Thanks again!