Skip to content

Commit

Permalink
Fixing all the other unrelated lints
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrogoe committed Aug 28, 2023
1 parent 7674d3e commit 70ea65c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 19 deletions.
3 changes: 1 addition & 2 deletions spec/sidekiq_unique_jobs/on_conflict/reject_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
end

before do
allow(strategy).to receive(:deadset).and_return(deadset)
allow(strategy).to receive(:payload).and_return(payload)
allow(strategy).to receive_messages(deadset: deadset, payload: payload)
end

describe "#replace?" do
Expand Down
9 changes: 3 additions & 6 deletions spec/sidekiq_unique_jobs/on_conflict/replace_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@
let(:jid) { "bogus" }

before do
allow(strategy).to receive(:delete_job_by_digest).and_return(jid)
allow(strategy).to receive_messages(delete_job_by_digest: jid, delete_lock: 9)
allow(strategy).to receive(:log_info).and_call_original
allow(strategy).to receive(:delete_lock).and_return(9)
end

it "logs important information" do
Expand All @@ -50,9 +49,8 @@
let(:jid) { "bogus" }

before do
allow(strategy).to receive(:delete_job_by_digest).and_return(jid)
allow(strategy).to receive_messages(delete_job_by_digest: jid, delete_lock: nil)
allow(strategy).to receive(:log_info).and_call_original
allow(strategy).to receive(:delete_lock).and_return(nil)
end

it "logs important information" do
Expand All @@ -68,9 +66,8 @@
let(:block) { nil }

before do
allow(strategy).to receive(:delete_job_by_digest).and_return(jid)
allow(strategy).to receive_messages(delete_job_by_digest: jid, delete_lock: nil)
allow(strategy).to receive(:log_info).and_call_original
allow(strategy).to receive(:delete_lock).and_return(nil)
end

it "does not call block" do
Expand Down
8 changes: 2 additions & 6 deletions spec/sidekiq_unique_jobs/orphans/manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@
before do
allow(SidekiqUniqueJobs::Orphans::Observer).to receive(:new).and_return(observer)

allow(described_class).to receive(:task).and_return(task)
allow(described_class).to receive_messages(task: task, log_info: nil)
allow(task).to receive(:add_observer).with(observer)
allow(task).to receive(:execute)

allow(described_class).to receive(:log_info).and_return(nil)
end

context "when registered?" do
Expand Down Expand Up @@ -72,11 +70,9 @@
before do
allow(SidekiqUniqueJobs::Orphans::Observer).to receive(:new).and_return(observer)

allow(described_class).to receive(:task).and_return(task)
allow(described_class).to receive_messages(task: task, log_info: nil)
allow(task).to receive(:add_observer).with(observer)
allow(task).to receive(:execute)

allow(described_class).to receive(:log_info).and_return(nil)
end

context "when unregistered?" do
Expand Down
4 changes: 1 addition & 3 deletions spec/sidekiq_unique_jobs/orphans/reaper_resurrector_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
end

before do
allow(described_class).to receive(:task).and_return(task)
allow(described_class).to receive_messages(task: task, log_info: nil)
allow(task).to receive(:execute)

allow(described_class).to receive(:log_info).and_return(nil)
end

context "when resurrector is disabled" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

before do
allow(lock).to receive(:locked?).and_return(initially_locked?, locked?)
allow(lock).to receive(:unlock).and_return(true)
allow(lock).to receive(:delete).and_return(true)
allow(lock).to receive_messages(unlock: true, delete: true)
allow(callback).to receive(:call).and_call_original
allow(block).to receive(:call).and_call_original
allow(lock).to receive(:log_warn)
Expand Down

0 comments on commit 70ea65c

Please sign in to comment.