paul / rspec-resembles_json_matchers

Do What The F*ck You Want To Public License
20 stars 0 forks source link

Fix: Empty actual array will not trigger mismatch #3

Closed brandonc closed 6 years ago

brandonc commented 6 years ago

I believe I've found a bug when an empty array will not mismatch a non-empty matcher:

This will pass:

expect({ "foo" => [] }).to resemble_json({ "foo" => [{ "id" => "bar" }]})

The fix that I'm attempting is to check whether their emptiness matches in addition to all values.

brandonc commented 6 years ago

@paul What do you think?

paul commented 6 years ago

Closing in favor of #5