collectiveidea / json_spec

Easily handle JSON in RSpec and Cucumber
rubygems.org/gems/json_spec
MIT License
917 stars 114 forks source link

provide better failure message for include_json class #42

Closed marshallshen closed 11 years ago

marshallshen commented 11 years ago

Background: When include_json spec fails, the information was "Expected included JSON" or "Expected excluded JSON". It is not very informative, thus this pull request.

In this PR, the following message will throw for a include_json case

%([[1,2,3],[4,5,6]]).should include_json(%([1,2]))

  1) JsonSpec::Matchers::IncludeJson matches an array included in an array
     Failure/Error: json.should include_json(%([1,2]))
       Expected [[1,2,3],[4,5,6]] included [1,2]
marshallshen commented 11 years ago

Close unreviewed PR.

johanneswuerbach commented 11 years ago

Why was this not merged? This current include output is not really helpful.