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 variables - they often leave you squinting, trying to see the line that's different.

But where did .diff() come from? should I know it's part of ActiveSupport::JSON or something?

_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to