m-richo/sensu_check-rspec — pull request #1 by johanek (2014-05-05 12:09:40+00:00)
Title: Fix for invalid escaped characters

Escape serverspec output so that it's valid JSON & use %() to make quoting the json string simpler

If you have escaped characters within a serverspec regex test, you'll get invalid JSON errors, i.e.

```
{"timestamp":"2014-05-05T12:50:32.653979+0100","level":"warn","message":"check result must be valid json","data":"{\"handlers\": [\"default\"], \"name\": \"authentication_spec.rb_117\", \"output\": \"File /etc/pam.d/sshd content should match /session\\s+include\\s+system-auth/\", \"status\": 0, \"priority\": \"normal\"}\n","error":"invalid escaped character at line 1, column 129 [load.c:1020]"}
```