Class: RSpec::Sidekiq::Matchers::BeUnique
- Inherits:
-
Object
- Object
- RSpec::Sidekiq::Matchers::BeUnique
- Defined in:
- lib/rspec/sidekiq/matchers/be_unique.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
- #matches?(job) ⇒ Boolean
Instance Method Details
#description ⇒ Object
9 10 11 |
# File 'lib/rspec/sidekiq/matchers/be_unique.rb', line 9 def description 'be unique in the queue' end |
#failure_message ⇒ Object
13 14 15 |
# File 'lib/rspec/sidekiq/matchers/be_unique.rb', line 13 def "expected #{@klass} to be unique in the queue" end |
#failure_message_when_negated ⇒ Object
23 24 25 |
# File 'lib/rspec/sidekiq/matchers/be_unique.rb', line 23 def "expected #{@klass} to not be unique in the queue" end |
#matches?(job) ⇒ Boolean
17 18 19 20 21 |
# File 'lib/rspec/sidekiq/matchers/be_unique.rb', line 17 def matches?(job) @klass = job.is_a?(Class) ? job : job.class @actual = @klass.['unique'] [true, :all].include?(@actual) end |