Refactor tailing and test it

This follows #227.

* Adds tests to the `Travis.Failing` object.
* Refactor a bit the object so it becomes testable.