Created
February 1, 2012 19:44
-
-
Save myronmarston/1718850 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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