mhenrixon/sidekiq-unique-jobs

Using rspec matcher and getting: `NameError: uninitialized constant SidekiqUniqueJobs::Lock::BaseLock::Validator`

edelauna opened this issue · 1 comments

Describe the bug
Version: sidekiq-unique-jobs (7.1.27)
As per the readme, trying to validate options.

#app/workers/bad_worker.rb
class BadWorker
  include Sidekiq::Job
  sidekiq_options lock: :while_executing, on_conflict: :replace
end

#spec/workers/bad_worker_spec.rb
require "sidekiq_unique_jobs/rspec/matchers"
# require "sidekiq_unique_jobs/testing" -- using this results in a different error

RSpec.describe OutboxMessageEvents::BadWorker do
  specify { expect(described_class).to have_valid_sidekiq_options }
end

Expected behavior

Expected BadWorker to have valid sidekiq options but found the following problems:
on_server_conflict: :replace is incompatible with the server process

Current behavior

 BadWorker is expected to have valid sidekiq options
   Failure/Error: specify { expect(described_class).to have_valid_sidekiq_options }

 NameError:
   uninitialized constant SidekiqUniqueJobs::Lock::BaseLock::Validator
 # ./spec/workers/bad_worker_spec.rb:4:in `block (2 levels) in <top (required)>'
 # -e:1:in `<main>'

Worker class

#app/workers/bad_worker.rb
class BadWorker
  include Sidekiq::Job
  sidekiq_options lock: :while_executing, on_conflict: :replace
end

Additional context
Add any other context about the problem here.

This should be closed by #827