gaslight/jasminerice-runner — pull request #9 by LeeXGreen (2014-09-10 15:07:16+00:00)
Title: Retry in case of Capybara::Poltergeist::TimeoutError

When running Jasmine specs, sometimes the whole capybara -> poltergeist -> phantomjs chain hangs. This presents itself as a TimeoutError.

This quick little hack just retries failing specs up to 4 times before giving up. Each time it encounters a timeout, we restart the PhantomJS driver.

For more info, see the following:

https://github.com/teampoltergeist/poltergeist/issues/375
https://github.com/ariya/phantomjs/issues/12234
https://gist.github.com/afn/c04ccfe71d648763b306