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.



39
40
41
# File 'lib/rspec/sidekiq/matchers/base.rb', line 39

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.



42
43
44
# File 'lib/rspec/sidekiq/matchers/base.rb', line 42

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.

Returns:

  • (Boolean)


44
45
46
47
48
# File 'lib/rspec/sidekiq/matchers/base.rb', line 44

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.



50
51
52
53
54
55
56
# File 'lib/rspec/sidekiq/matchers/base.rb', line 50

def unwrapped_arguments
  args = job["args"]

  return deserialized_active_job_args if active_job?

  args
end