Class: RSpec::Rewind::Configuration
- Inherits:
-
Object
- Object
- RSpec::Rewind::Configuration
- Includes:
- ConfigurationValidation, MatcherValidation
- Defined in:
- lib/rspec/rewind/configuration.rb
Instance Attribute Summary collapse
-
#after_retry ⇒ Object
Returns the value of attribute after_retry.
-
#backoff ⇒ Object
Returns the value of attribute backoff.
-
#before_retry ⇒ Object
Returns the value of attribute before_retry.
-
#clear_lets_on_failure ⇒ Object
Returns the value of attribute clear_lets_on_failure.
-
#clock ⇒ Object
Returns the value of attribute clock.
-
#default_retries ⇒ Object
Returns the value of attribute default_retries.
-
#detect_retry_gem_conflicts ⇒ Object
Returns the value of attribute detect_retry_gem_conflicts.
-
#display_retry_backtrace_top ⇒ Object
Returns the value of attribute display_retry_backtrace_top.
-
#display_retry_failure_messages ⇒ Object
Returns the value of attribute display_retry_failure_messages.
-
#display_retry_summary ⇒ Object
Returns the value of attribute display_retry_summary.
-
#dry_run ⇒ Object
Returns the value of attribute dry_run.
-
#fail_on_flaky ⇒ Object
Returns the value of attribute fail_on_flaky.
-
#flaky_callback ⇒ Object
Returns the value of attribute flaky_callback.
-
#flaky_report_path ⇒ Object
Returns the value of attribute flaky_report_path.
-
#flaky_reporter ⇒ Object
Returns the value of attribute flaky_reporter.
-
#freeze_configuration_at_suite_start ⇒ Object
Returns the value of attribute freeze_configuration_at_suite_start.
-
#max_elapsed_time ⇒ Object
Returns the value of attribute max_elapsed_time.
-
#max_flaky_examples ⇒ Object
Returns the value of attribute max_flaky_examples.
-
#max_retries ⇒ Object
Returns the value of attribute max_retries.
-
#max_total_sleep ⇒ Object
Returns the value of attribute max_total_sleep.
-
#metadata_report_keys ⇒ Object
Returns the value of attribute metadata_report_keys.
-
#not_retried_callback ⇒ Object
Returns the value of attribute not_retried_callback.
-
#report_retry_events ⇒ Object
Returns the value of attribute report_retry_events.
-
#reset_failure_policy ⇒ Object
Returns the value of attribute reset_failure_policy.
-
#retry_budget ⇒ Object
Returns the value of attribute retry_budget.
-
#retry_callback ⇒ Object
Returns the value of attribute retry_callback.
-
#retry_if ⇒ Object
Returns the value of attribute retry_if.
-
#retry_if_mode ⇒ Object
Returns the value of attribute retry_if_mode.
-
#retry_on ⇒ Object
Returns the value of attribute retry_on.
-
#retry_on_default ⇒ Object
Returns the value of attribute retry_on_default.
-
#retry_summary ⇒ Object
Returns the value of attribute retry_summary.
-
#skip_retry_on ⇒ Object
Returns the value of attribute skip_retry_on.
-
#sleeper ⇒ Object
Returns the value of attribute sleeper.
-
#strict_callable_arity ⇒ Object
Returns the value of attribute strict_callable_arity.
-
#strict_callbacks ⇒ Object
Returns the value of attribute strict_callbacks.
-
#strict_matcher_validation ⇒ Object
Returns the value of attribute strict_matcher_validation.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
-
#warn_on_delay_conflict ⇒ Object
Returns the value of attribute warn_on_delay_conflict.
Instance Method Summary collapse
- #freeze ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #snapshot ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/rspec/rewind/configuration.rb', line 20 def initialize self.default_retries = 0 self.backoff = Backoff.fixed(0) self.strict_matcher_validation = false self.retry_on = [] self.skip_retry_on = [] self.retry_if = nil self.retry_callback = nil self.flaky_callback = nil self.not_retried_callback = nil self.before_retry = nil self.after_retry = nil self.retry_summary = RetrySummary.new self.verbose = false self. = false self.display_retry_backtrace_top = false self.display_retry_summary = false self.fail_on_flaky = false self.max_flaky_examples = nil self.freeze_configuration_at_suite_start = false self.warn_on_delay_conflict = true self.detect_retry_gem_conflicts = true self.clear_lets_on_failure = true self.reset_failure_policy = :raise self.retry_budget = nil self.flaky_reporter = FlakyReporter.null self.flaky_report_path = nil self.retry_if_mode = :override self.retry_on_default = :all self.report_retry_events = false self.strict_callbacks = false self.strict_callable_arity = false self. = [] self.max_retries = nil self.max_elapsed_time = nil self.max_total_sleep = nil self.sleeper = Kernel.method(:sleep) self.clock = -> { Process.clock_gettime(Process::CLOCK_MONOTONIC) } self.dry_run = false end |
Instance Attribute Details
#after_retry ⇒ Object
Returns the value of attribute after_retry.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def after_retry @after_retry end |
#backoff ⇒ Object
Returns the value of attribute backoff.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def backoff @backoff end |
#before_retry ⇒ Object
Returns the value of attribute before_retry.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def before_retry @before_retry end |
#clear_lets_on_failure ⇒ Object
Returns the value of attribute clear_lets_on_failure.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def clear_lets_on_failure @clear_lets_on_failure end |
#clock ⇒ Object
Returns the value of attribute clock.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def clock @clock end |
#default_retries ⇒ Object
Returns the value of attribute default_retries.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def default_retries @default_retries end |
#detect_retry_gem_conflicts ⇒ Object
Returns the value of attribute detect_retry_gem_conflicts.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def detect_retry_gem_conflicts @detect_retry_gem_conflicts end |
#display_retry_backtrace_top ⇒ Object
Returns the value of attribute display_retry_backtrace_top.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def display_retry_backtrace_top @display_retry_backtrace_top end |
#display_retry_failure_messages ⇒ Object
Returns the value of attribute display_retry_failure_messages.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def @display_retry_failure_messages end |
#display_retry_summary ⇒ Object
Returns the value of attribute display_retry_summary.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def display_retry_summary @display_retry_summary end |
#dry_run ⇒ Object
Returns the value of attribute dry_run.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def dry_run @dry_run end |
#fail_on_flaky ⇒ Object
Returns the value of attribute fail_on_flaky.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def fail_on_flaky @fail_on_flaky end |
#flaky_callback ⇒ Object
Returns the value of attribute flaky_callback.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def flaky_callback @flaky_callback end |
#flaky_report_path ⇒ Object
Returns the value of attribute flaky_report_path.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def flaky_report_path @flaky_report_path end |
#flaky_reporter ⇒ Object
Returns the value of attribute flaky_reporter.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def flaky_reporter @flaky_reporter end |
#freeze_configuration_at_suite_start ⇒ Object
Returns the value of attribute freeze_configuration_at_suite_start.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def freeze_configuration_at_suite_start @freeze_configuration_at_suite_start end |
#max_elapsed_time ⇒ Object
Returns the value of attribute max_elapsed_time.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def max_elapsed_time @max_elapsed_time end |
#max_flaky_examples ⇒ Object
Returns the value of attribute max_flaky_examples.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def max_flaky_examples @max_flaky_examples end |
#max_retries ⇒ Object
Returns the value of attribute max_retries.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def max_retries @max_retries end |
#max_total_sleep ⇒ Object
Returns the value of attribute max_total_sleep.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def max_total_sleep @max_total_sleep end |
#metadata_report_keys ⇒ Object
Returns the value of attribute metadata_report_keys.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def @metadata_report_keys end |
#not_retried_callback ⇒ Object
Returns the value of attribute not_retried_callback.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def not_retried_callback @not_retried_callback end |
#report_retry_events ⇒ Object
Returns the value of attribute report_retry_events.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def report_retry_events @report_retry_events end |
#reset_failure_policy ⇒ Object
Returns the value of attribute reset_failure_policy.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def reset_failure_policy @reset_failure_policy end |
#retry_budget ⇒ Object
Returns the value of attribute retry_budget.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def retry_budget @retry_budget end |
#retry_callback ⇒ Object
Returns the value of attribute retry_callback.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def retry_callback @retry_callback end |
#retry_if ⇒ Object
Returns the value of attribute retry_if.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def retry_if @retry_if end |
#retry_if_mode ⇒ Object
Returns the value of attribute retry_if_mode.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def retry_if_mode @retry_if_mode end |
#retry_on ⇒ Object
Returns the value of attribute retry_on.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def retry_on @retry_on end |
#retry_on_default ⇒ Object
Returns the value of attribute retry_on_default.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def retry_on_default @retry_on_default end |
#retry_summary ⇒ Object
Returns the value of attribute retry_summary.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def retry_summary @retry_summary end |
#skip_retry_on ⇒ Object
Returns the value of attribute skip_retry_on.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def skip_retry_on @skip_retry_on end |
#sleeper ⇒ Object
Returns the value of attribute sleeper.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def sleeper @sleeper end |
#strict_callable_arity ⇒ Object
Returns the value of attribute strict_callable_arity.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def strict_callable_arity @strict_callable_arity end |
#strict_callbacks ⇒ Object
Returns the value of attribute strict_callbacks.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def strict_callbacks @strict_callbacks end |
#strict_matcher_validation ⇒ Object
Returns the value of attribute strict_matcher_validation.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def strict_matcher_validation @strict_matcher_validation end |
#verbose ⇒ Object
Returns the value of attribute verbose.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def verbose @verbose end |
#warn_on_delay_conflict ⇒ Object
Returns the value of attribute warn_on_delay_conflict.
9 10 11 |
# File 'lib/rspec/rewind/configuration.rb', line 9 def warn_on_delay_conflict @warn_on_delay_conflict end |
Instance Method Details
#freeze ⇒ Object
237 238 239 240 |
# File 'lib/rspec/rewind/configuration.rb', line 237 def freeze freeze_mutable_policy_state super end |
#snapshot ⇒ Object
242 243 244 245 246 247 248 |
# File 'lib/rspec/rewind/configuration.rb', line 242 def snapshot copy = dup copy.instance_variable_set(:@retry_on, @retry_on.dup) copy.instance_variable_set(:@skip_retry_on, @skip_retry_on.dup) copy.instance_variable_set(:@metadata_report_keys, @metadata_report_keys.dup) copy.freeze end |