Class: RSpec::Sidekiq::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/sidekiq/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



11
12
13
14
15
16
17
18
19
# File 'lib/rspec/sidekiq/configuration.rb', line 11

def initialize
  # Display settings defaults
  @enable_terminal_colours = true

  # Functional settings defaults
  @clear_all_enqueued_jobs = true
  @warn_when_jobs_not_processed_by_sidekiq = true
  @silence_warnings = Set.new
end

Instance Attribute Details

#clear_all_enqueued_jobsObject

Returns the value of attribute clear_all_enqueued_jobs.



7
8
9
# File 'lib/rspec/sidekiq/configuration.rb', line 7

def clear_all_enqueued_jobs
  @clear_all_enqueued_jobs
end

#enable_terminal_coloursObject

Returns the value of attribute enable_terminal_colours.



7
8
9
# File 'lib/rspec/sidekiq/configuration.rb', line 7

def enable_terminal_colours
  @enable_terminal_colours
end

#warn_when_jobs_not_processed_by_sidekiqObject

Returns the value of attribute warn_when_jobs_not_processed_by_sidekiq.



7
8
9
# File 'lib/rspec/sidekiq/configuration.rb', line 7

def warn_when_jobs_not_processed_by_sidekiq
  @warn_when_jobs_not_processed_by_sidekiq
end

Instance Method Details

#sidekiq_gte_7?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/rspec/sidekiq/configuration.rb', line 21

def sidekiq_gte_7?
  Gem::Version.new(::Sidekiq::VERSION) >= Gem::Version.new("7.0.0")
end

#silence_warning(symbol) ⇒ Object



25
26
27
# File 'lib/rspec/sidekiq/configuration.rb', line 25

def silence_warning(symbol)
  @silence_warnings << symbol
end

#warn_for?(symbol) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/rspec/sidekiq/configuration.rb', line 29

def warn_for?(symbol)
  !@silence_warnings.include?(symbol)
end