Class: RSpec::Sidekiq::Configuration
- Inherits:
-
Object
- Object
- RSpec::Sidekiq::Configuration
- Defined in:
- lib/rspec/sidekiq/configuration.rb
Instance Attribute Summary collapse
-
#clear_all_enqueued_jobs ⇒ Object
Returns the value of attribute clear_all_enqueued_jobs.
-
#enable_terminal_colours ⇒ Object
Returns the value of attribute enable_terminal_colours.
-
#warn_when_jobs_not_processed_by_sidekiq ⇒ Object
Returns the value of attribute warn_when_jobs_not_processed_by_sidekiq.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #sidekiq_gte_7? ⇒ Boolean
- #sidekiq_gte_8? ⇒ Boolean
- #silence_warning(symbol) ⇒ Object
- #warn_for?(symbol) ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
13 14 15 16 17 18 19 20 21 |
# File 'lib/rspec/sidekiq/configuration.rb', line 13 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_jobs ⇒ Object
Returns the value of attribute clear_all_enqueued_jobs.
9 10 11 |
# File 'lib/rspec/sidekiq/configuration.rb', line 9 def clear_all_enqueued_jobs @clear_all_enqueued_jobs end |
#enable_terminal_colours ⇒ Object
Returns the value of attribute enable_terminal_colours.
9 10 11 |
# File 'lib/rspec/sidekiq/configuration.rb', line 9 def enable_terminal_colours @enable_terminal_colours end |
#warn_when_jobs_not_processed_by_sidekiq ⇒ Object
Returns the value of attribute warn_when_jobs_not_processed_by_sidekiq.
9 10 11 |
# File 'lib/rspec/sidekiq/configuration.rb', line 9 def warn_when_jobs_not_processed_by_sidekiq @warn_when_jobs_not_processed_by_sidekiq end |
Instance Method Details
#sidekiq_gte_7? ⇒ Boolean
23 24 25 |
# File 'lib/rspec/sidekiq/configuration.rb', line 23 def sidekiq_gte_7? Gem::Version.new(::Sidekiq::VERSION) >= Gem::Version.new("7.0.0") end |
#sidekiq_gte_8? ⇒ Boolean
27 28 29 |
# File 'lib/rspec/sidekiq/configuration.rb', line 27 def sidekiq_gte_8? Gem::Version.new(::Sidekiq::VERSION) >= Gem::Version.new("8.0.0") end |
#silence_warning(symbol) ⇒ Object
31 32 33 |
# File 'lib/rspec/sidekiq/configuration.rb', line 31 def silence_warning(symbol) @silence_warnings << symbol end |
#warn_for?(symbol) ⇒ Boolean
35 36 37 |
# File 'lib/rspec/sidekiq/configuration.rb', line 35 def warn_for?(symbol) !@silence_warnings.include?(symbol) end |