class RSpec::Sidekiq::Matchers::BeExpiredIn
Public Class Methods
Source
# File lib/rspec/sidekiq/matchers/be_expired_in.rb, line 11 def initialize(expected_argument) @expected_argument = expected_argument end
Public Instance Methods
Source
# File lib/rspec/sidekiq/matchers/be_expired_in.rb, line 15 def description "to expire in #{@expected_argument}" end
Source
# File lib/rspec/sidekiq/matchers/be_expired_in.rb, line 19 def failure_message "expected to expire in #{@expected_argument} but expired in #{@actual}" end
Source
# File lib/rspec/sidekiq/matchers/be_expired_in.rb, line 23 def failure_message_when_negated "expected to not expire in #{@expected_argument}" end
Source
# File lib/rspec/sidekiq/matchers/be_expired_in.rb, line 27 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