Skip to content

Instantly share code, notes, and snippets.

@myronmarston
Created February 1, 2012 19:44
Show Gist options
  • Save myronmarston/1718850 to your computer and use it in GitHub Desktop.
Save myronmarston/1718850 to your computer and use it in GitHub Desktop.
RSpec.configure do |config|
config.around(:each, :max_retries => lambda { |m| !!m }) do |example|
retries = example.metadata[:max_retries]
begin
example.run
rescue => e
retries -= 1
retry if retries >= 0
raise
end
end
end
describe "Integration" do
it 'does something that fails intermittently', :max_retries => 3 do
# ...
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment