hspec/hspec-wai — pull request #8 by alpmestan (2014-06-13 15:21:14+00:00)
Title: add some expectation-generators that will check that a predicate succeeds.

There are combinators for the following elements of the response: the response itself, its body, its headers, its status, or the body decoded from json.

``` haskell
-- | Check that the response satisfies the given predicate
responseSatisfies :: WaiSession SResponse -> (SResponse -> Bool) -> WaiExpectation

-- | Check that the body of the response satisfies the given predicate
bodySatisfies :: WaiSession SResponse -> (LB.ByteString -> Bool) -> WaiExpectation

-- | Check that the 'Status' of the response satisfies the given predicate
statusSatisfies :: WaiSession SResponse -> (Status -> Bool) -> WaiExpectation

-- | Check that the 'Header's sastify the given predicate
headersSatisfy :: WaiSession SResponse -> ([Header] -> Bool) -> WaiExpectation

-- | Check that:
--
-- * the (JSON) body can successfully be decoded to the target type
-- * the value obtained that way matches the given predicate
jsonBodySatisfies :: (Show a, FromJSON a) => WaiSession SResponse -> (a -> Bool) -> WaiExpectation
```

I'l definitely need those, so maybe you'll be interested in integrating them directly?