rspec-snapshot
rspec-snapshot copied to clipboard
Allowing to compare the JSON structure only
I made this gem allow accept an optional second param on its match
def match_snapshot(snapshot_name, json_structure_only = false)
MatchSnapShot.new(self.class.metadata, snapshot_name, json_structure_only)
end
it makes the match check only the structure of JSON object to ensure if the actual
and expected
have the same structure keys and same kind of object on its value.
It is really useful for me, I use Faker to create my tests and with this I don't care with the values itself but just only if my API is getting the same data structure.
I hope it is useful for more people.
A good idea is create a new match, to make this stuff clear, instead of have only match_snapshot
with an optional param, we can have another match called for example: match_deep_json_snapshot
or match_json_structure_snapshot
. What do you think guys?
Needs rebased
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
No data about Duplication