dbp/snap-testing — pull request #4 by timmytofu (2014-08-20 20:56:26+00:00)
Title: Style suggestion

This isn't a proper pull request as it's not fully developed, but I was wondering if you've considered any of this.

This redefines should and shouldNot to take a TestResult rather than SnapTesting. That alone isn't much, it just lets you do do-block in another way.

When you flip the order of arguments given to TestResult-producers like haveSelector, though, you get some more flexibility to compose tests easily in a block-like fashion and limit the number of times you actually hit your code — that is, you can make a call to one of your routes and run a number of tests against the response with a minimum of redundant typing.

I haven't looked through all of snap-testing yet, though, so perhaps there's a good reason not to do this. But, from where I stand, it's a bit more idiomatic.

See the additions in test/Main.hs for commentary.