csquared/IMGKit — pull request #40 by dukedave (2013-02-19 16:16:28+00:00)
Title: Updated README about options, raise CommandFailedError more aggressively

I was formatting an option incorrectly (giving `:cookie` as `'key value'` instead of `['key', 'value']`), causing `wkhtmltoimage` to exit with error (and not generate an image).
Unfortunately, `wkhtmltoimage` was writing a few new lines characters to `stdout` before exiting, as such `result.size == 0` was false and `CommandFailedError` was **not** raised.
I ended up with no about information what happened, and a garbage image file.

In this pull:

1. I've updated README.md to be more explicit about setting options.
1. Now we check the exit status of the `wkhtmltoimage` to see if it was successful.

Because the existing `spec/error_binary` script already finishes with `exit 1`, no changes were required to the spec suite (and everything still passes).