colby-swandale/guard-codeception — pull request #3 by mobileka (2014-05-01 07:51:19+00:00)
Title: Add notification options and fix parser

I'm not a Ruby-guy and not a regexp guru, so please fix coding style or anything else if it's not optimal.

There was a problem in original code, because it was notifying only on success and was showing wrong data (0 assertions, 0 tests, etc.)

The problem is that Codeception outputs the following message on successful testing:
`OK (4 tests, 16 assertions)`

And when something goes wrong:

```
FAILURES!
Tests: 4, Assertions: 12, Failures: 1.
```

![selection_002](https://cloud.githubusercontent.com/assets/1132388/2850652/0d903120-d105-11e3-921a-53ce878c2262.png)
![selection_003](https://cloud.githubusercontent.com/assets/1132388/2850651/0d8fde32-d105-11e3-90a5-c00721e6f3af.png)

The regexp in `parser.rb` were matching only failure text but `run` method in `runner.rb` was firing notifications only on successful testing.

Additionally, I've added two new options: `notify_on_error` and `notify_on_success`. I prefer to be notified only when something is wrong, so I set:
`:notify_on_error => true` and `notify_on_success => false`

The default values are left as it they were in the original code (notify only on success).