yesodweb / yesod

A RESTful Haskell web framework built on WAI.
http://www.yesodweb.com/
MIT License
2.64k stars 374 forks source link

Add yesod-test assertDiffEqual #1256

Open bitemyapp opened 8 years ago

bitemyapp commented 8 years ago

Cf. #1255

There are libraries for pretty-printing, there are libraries for diffing. There's not a fantastically good reason we don't already have an assertEqual helper which doesn't both report the values that weren't equal but also shrink the report to a path and the individual components that weren't equal or which syntax highlights the components that were not alike (such as in a record).

This one can be in a different function.

snoyberg commented 8 years ago

I'm in favor. My only additional thought: maybe this functionality really belongs in hspec instead, and we could just leverage it from there.

bitemyapp commented 8 years ago

@snoyberg mayhaps but yesod-test hadn't really been using hspec's stuff directly/properly (cf. assertEqual) so I was trying to take the path of least resistance to getting this out there.

I'll do what I can to get it into hspec if I figure it out.

snoyberg commented 8 years ago

I have no objection if the functionality lives in yesod-test, your call.