JSON matcher updated (works with Rspec 1.3.1). Put this in
spec/support/matchers/json_matcher.rb:
Spec::Matchers.define :be_json_eql do | expected |
match do | actual |
@expected = decode(expected, 'expected')
@actual = decode(actual, 'actual')
@actual == @expected
end
failure_m
On Tuesday 07 April 2009, Phlip wrote:
> Michael Schuerig wrote:
> > def failure_message
> > "expected\...@raw_target}\n" +
> > "to be JSON code equivalent to\...@raw_expected}\n" +
> > "Difference:\...@expected.diff(@target).inspect}"
> > end
>
> Nice - this fix
Michael Schuerig wrote:
def failure_message
"expected\...@raw_target}\n" +
"to be JSON code equivalent to\...@raw_expected}\n" +
"Difference:\...@expected.diff(@target).inspect}"
end
Nice - this fixes the common problem with assertions on large bulky variabl