r7kamura / rspec-json_matcher

RSpec matcher for testing JSON string
MIT License
171 stars 10 forks source link

Fuzzy matcher & Exact matcher #2

Closed r7kamura closed 10 years ago

r7kamura commented 10 years ago

It would be nice if there is another matcher that does not check keys but does values. (We have room for thoughts of the matcher names.)

actual = { "a" => "b", "c" => "d" }.to_json

# same with the current `be_json` matcher
actual.should be_json_as("a" => "b", "c" => "d")

# almost same but allows subset of `actual`
actual.should be_json_including("a" => "b")