thoughtbot/shoulda-matchers — pull request #374 by mcmire (2013-10-23 23:36:26+00:00)
Title: Auto-retry `bundle install` when Travis runs tests

`bundle install` doesn't always work -- sometimes it runs into errors making HTTP requests, for whatever reason. This will cause Travis to fail which is pretty annoying.

* Travis supplies an executable called `travis_retry` which will automatically retry the command up to 3 times before really failing. Tell Travis to use this when it runs `bundle install` before it runs tests.

* In spec_helper, we create a Rails app and use this within the test suite. This will also run `bundle install`. Unfortunately we can't use `travis_retry` for this as it's a function and is not available to us in Ruby-land, so use our own retry logic.