File: spec_helper.rb

package info (click to toggle)
ruby-rspec-retry 0.6.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 220 kB
  • sloc: ruby: 574; makefile: 6
file content (22 lines) | stat: -rw-r--r-- 483 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'rspec'
require 'rspec/core/sandbox'

require 'rspec/retry'

RSpec.configure do |config|
  config.verbose_retry = true
  config.display_try_failure_messages = true

  config.around :example do |ex|
    RSpec::Core::Sandbox.sandboxed do |config|
      RSpec::Retry.setup
      ex.run
    end
  end

  config.around :each, :overridden do |ex|
    ex.run_with_retry retry: 3
  end

  config.retry_count_condition = ->(example) { example.metadata[:retry_me_once] ? 2 : nil }
end