-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f53322
commit a36d3e3
Showing
8 changed files
with
76 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
require "spec_helper" | ||
|
||
describe "Be Retryable matcher" do | ||
|
||
describe "expect syntax" do | ||
context "when retryable is number" do | ||
it "correctly matches" do | ||
expect(TestWorker).to be_retryable 5 | ||
end | ||
end | ||
|
||
context "when retryable is true" do | ||
it "correctly matches" do | ||
expect(TestWorkerDefaults).to be_retryable true | ||
end | ||
end | ||
|
||
context "when retryable is false" do | ||
it "correctly matches" do | ||
expect(TestWorkerAlternative).to be_retryable false | ||
end | ||
end | ||
end | ||
|
||
describe "one liner syntax" do | ||
context "when retryable is number" do | ||
subject { TestWorker } | ||
expect_it { to be_retryable 5 } | ||
end | ||
|
||
context "when retryable is true" do | ||
subject { TestWorkerDefaults } | ||
expect_it { to be_retryable true } | ||
end | ||
|
||
context "when retryable is false" do | ||
subject { TestWorkerAlternative } | ||
expect_it { to be_retryable false } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require "spec_helper" | ||
|
||
describe "Be Unique matcher" do | ||
subject { TestWorker } | ||
|
||
describe "expect syntax" do | ||
it "correctly matches" do | ||
expect(TestWorker).to be_unique | ||
end | ||
end | ||
|
||
describe "one liner syntax" do | ||
expect_it { to be_unique } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
require_relative "test_worker" | ||
require_relative "test_worker" | ||
require_relative "test_worker_alternative" | ||
require_relative "test_worker_defaults" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class TestWorkerAlternative | ||
include Sidekiq::Worker | ||
|
||
sidekiq_options queue: "data", retry: false, unique: false | ||
|
||
def perform | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class TestWorkerDefaults | ||
include Sidekiq::Worker | ||
|
||
def perform | ||
end | ||
end |