NoRedInk / rspec-retry

retry randomly failing rspec example
MIT License
581 stars 95 forks source link

Don't execute before(:all) on retry runs #101

Open jkosir opened 5 years ago

jkosir commented 5 years ago

Is it possible to somehow not run before(:all) block (or access retry_count in it) on retry runs?

michaelglass commented 5 years ago

Do you know if after(:all) is called? if not, you could do something like:

before(:all) do
  if @dont_rerun_before_all
    # ...
  @dont_rerun_before_all = true
end

after(:all) do
  @dont_rerun_before_all = false
end