mattetti/Weasel-Diesel — pull request #25 by raul (2013-06-02 13:25:31+00:00)
Title: Support top level array responses

While adding support for top-level array responses I found `JSONResponseVerification`'s internals a bit complicated so I refactored them. Some notes:

- I've replaced `#validate_hash_response` with a more vague `#verify`: the input now can be a hash or an array, and once we extend WD so specify response headers and status code we'll probably want to verify headers, status code and the response body under a single `#verify` public method. The old method is still supported as an alias, but I'd like to remove it once we bump to a new version if this PR gets approved.
- To avoid passing errors around, they are now returned in nested arrays which get `flatten`ed before being returned.
- This is the first time I apply Yard to document methods, so I'd appreciate a quick review in the doc comments.
- I've respected the original way of managing an unknown data type (printing a message and not verifying it at all), though it may be better to raise an exception instead.

All specs are passing but I don't have an actual production API to test it yet, so cases not covered by the test suite may break.