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
- #silence_warning(symbol) ⇒ Object
- #warn_for?(symbol) ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
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_jobs ⇒ Object
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_colours ⇒ Object
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_sidekiq ⇒ Object
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
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
29 30 31 |
# File 'lib/rspec/sidekiq/configuration.rb', line 29 def warn_for?(symbol) !@silence_warnings.include?(symbol) end |