class RSpec::Sidekiq::Matchers::BeExpiredIn
Public Class Methods
new(expected_argument)
click to toggle source
# File lib/rspec/sidekiq/matchers/be_expired_in.rb, line 9 def initialize(expected_argument) @expected_argument = expected_argument end
Public Instance Methods
description()
click to toggle source
# File lib/rspec/sidekiq/matchers/be_expired_in.rb, line 13 def description "to expire in #{@expected_argument}" end
failure_message()
click to toggle source
# File lib/rspec/sidekiq/matchers/be_expired_in.rb, line 17 def failure_message "expected to expire in #{@expected_argument} but expired in #{@actual}" end
failure_message_when_negated()
click to toggle source
# File lib/rspec/sidekiq/matchers/be_expired_in.rb, line 21 def failure_message_when_negated "expected to not expire in #{@expected_argument}" end
matches?(job)
click to toggle source
# File lib/rspec/sidekiq/matchers/be_expired_in.rb, line 25 def matches?(job) @klass = job.is_a?(Class) ? job : job.class @actual = @klass.get_sidekiq_options['expires_in'] @actual.to_s == @expected_argument.to_s end