Class: RSpec::Sidekiq::Matchers::JobArguments Private

Inherits:
Object
  • Object
show all
Includes:
Mocks::ArgumentMatchers
Defined in:
lib/rspec/sidekiq/matchers/base.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(job) ⇒ JobArguments

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of JobArguments.



91
92
93
# File 'lib/rspec/sidekiq/matchers/base.rb', line 91

def initialize(job)
  self.job = job
end

Instance Attribute Details

#jobObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



94
95
96
# File 'lib/rspec/sidekiq/matchers/base.rb', line 94

def job
  @job
end

Instance Method Details

#matches?(expected_args) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



96
97
98
99
100
# File 'lib/rspec/sidekiq/matchers/base.rb', line 96

def matches?(expected_args)
  matcher = RSpec::Mocks::ArgumentListMatcher.new(*expected_args)

  matcher.args_match?(*unwrapped_arguments)
end

#unwrapped_argumentsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



102
103
104
105
106
107
108
# File 'lib/rspec/sidekiq/matchers/base.rb', line 102

def unwrapped_arguments
  @unwrapped_arguments ||= begin
    args = job["args"]

    active_job? ? deserialized_active_job_args : args
  end
end