rspec-sidekiq 0.5.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +9 -9
- data/.gitattributes +22 -22
- data/.gitignore +1 -1
- data/.rspec +2 -2
- data/.simplecov +5 -0
- data/CHANGES.md +52 -35
- data/Gemfile +8 -2
- data/LICENSE +8 -8
- data/README.md +181 -135
- data/lib/rspec/sidekiq/batch.rb +46 -43
- data/lib/rspec/sidekiq/configuration.rb +12 -10
- data/lib/rspec/sidekiq/helpers/within_sidekiq_retries_exhausted_block.rb +11 -0
- data/lib/rspec/sidekiq/helpers.rb +2 -0
- data/lib/rspec/sidekiq/matchers/be_delayed.rb +67 -0
- data/lib/rspec/sidekiq/matchers/be_processed_in.rb +32 -32
- data/lib/rspec/sidekiq/matchers/be_retryable.rb +38 -38
- data/lib/rspec/sidekiq/matchers/be_unique.rb +28 -28
- data/lib/rspec/sidekiq/matchers/have_enqueued_job.rb +33 -33
- data/lib/rspec/sidekiq/matchers/have_enqueued_jobs.rb +11 -36
- data/lib/rspec/sidekiq/matchers.rb +10 -9
- data/lib/rspec/sidekiq/sidekiq.rb +24 -20
- data/lib/rspec/sidekiq/version.rb +4 -4
- data/lib/rspec-sidekiq.rb +7 -6
- data/rspec-sidekiq.gemspec +35 -34
- data/spec/rspec/sidekiq/batch_spec.rb +27 -0
- data/spec/rspec/sidekiq/helpers/retries_exhausted_spec.rb +18 -0
- data/spec/rspec/sidekiq/matchers/be_delayed_spec.rb +238 -0
- data/spec/rspec/sidekiq/matchers/be_processed_in_spec.rb +107 -28
- data/spec/rspec/sidekiq/matchers/be_retryable_spec.rb +128 -40
- data/spec/rspec/sidekiq/matchers/be_unique_spec.rb +49 -14
- data/spec/rspec/sidekiq/matchers/have_enqueued_job_spec.rb +73 -0
- data/spec/rspec/sidekiq/matchers/have_enqueued_jobs_spec.rb +9 -0
- data/spec/rspec/sidekiq/sidekiq_spec.rb +15 -0
- data/spec/rspec/sidekiq/version_spec.rb +4 -6
- data/spec/spec_helper.rb +27 -25
- data/spec/support/factories.rb +22 -0
- data/spec/support/init.rb +3 -3
- data/spec/support/test_worker.rb +7 -7
- data/spec/support/test_worker_alternative.rb +7 -7
- metadata +29 -21
- data/spec/support/test_worker_defaults.rb +0 -6
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjNiZmI2MTNlM2Q2ZDBjOTlmYTU4NTliYzlkZDUyODY0Y2RiNmE0Mw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
7
|
-
|
6
|
+
YzlmNjA3MjViZDdhNDhkMWM2Y2FiZjBiZjNlNmE3YzI3Yjk0MTk2OA==
|
7
|
+
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NWE0YjVkYmE5YjZkZGZlNmIyN2JkNDdlNjNlZDE0MWI5NDY1ZGUxZTZmYzE3
|
10
|
+
YTMyZWM1MGY0YTkwNWI1YTBkN2E3MmQwNmU5ZjRlMGY4YTgyYjUxOGI2Nzkx
|
11
|
+
MDJhNjgyMGZkYmRkMDViODE0M2Y1Yzg1MTFkMzZkYjRhYTFjOWY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
N2I3M2Y1ODZmYjY4YTA0MGVhYWM5ODhlNTU3YjBjYTQ5ZDcxYzdlNjM4NmM4
|
14
|
+
ODg3OTVjNzZmOTFiYzc4NTNjZWZhMThjZjZkOGIwMTk5MDM5YzVlY2JiZjE3
|
15
|
+
ZGU0ODYwMjBiODc0YmE0MDFhZTllYjZiNWNkNzYxZjhhNDMzMDc=
|
data/.gitattributes
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
# Auto detect text files and perform LF normalization
|
2
|
-
* text=auto
|
3
|
-
|
4
|
-
# Custom for Visual Studio
|
5
|
-
*.cs diff=csharp
|
6
|
-
*.sln merge=union
|
7
|
-
*.csproj merge=union
|
8
|
-
*.vbproj merge=union
|
9
|
-
*.fsproj merge=union
|
10
|
-
*.dbproj merge=union
|
11
|
-
|
12
|
-
# Standard to msysgit
|
13
|
-
*.doc diff=astextplain
|
14
|
-
*.DOC diff=astextplain
|
15
|
-
*.docx diff=astextplain
|
16
|
-
*.DOCX diff=astextplain
|
17
|
-
*.dot diff=astextplain
|
18
|
-
*.DOT diff=astextplain
|
19
|
-
*.pdf diff=astextplain
|
20
|
-
*.PDF diff=astextplain
|
21
|
-
*.rtf diff=astextplain
|
22
|
-
*.RTF diff=astextplain
|
1
|
+
# Auto detect text files and perform LF normalization
|
2
|
+
* text=auto
|
3
|
+
|
4
|
+
# Custom for Visual Studio
|
5
|
+
*.cs diff=csharp
|
6
|
+
*.sln merge=union
|
7
|
+
*.csproj merge=union
|
8
|
+
*.vbproj merge=union
|
9
|
+
*.fsproj merge=union
|
10
|
+
*.dbproj merge=union
|
11
|
+
|
12
|
+
# Standard to msysgit
|
13
|
+
*.doc diff=astextplain
|
14
|
+
*.DOC diff=astextplain
|
15
|
+
*.docx diff=astextplain
|
16
|
+
*.DOCX diff=astextplain
|
17
|
+
*.dot diff=astextplain
|
18
|
+
*.DOT diff=astextplain
|
19
|
+
*.pdf diff=astextplain
|
20
|
+
*.PDF diff=astextplain
|
21
|
+
*.rtf diff=astextplain
|
22
|
+
*.RTF diff=astextplain
|
data/.gitignore
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
Gemfile.lock
|
1
|
+
Gemfile.lock
|
2
2
|
spec_result
|
data/.rspec
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
--colour
|
2
|
-
--format Fuubar
|
1
|
+
--colour
|
2
|
+
--format Fuubar
|
3
3
|
--format html --out spec_result/rspec.html
|
data/.simplecov
ADDED
data/CHANGES.md
CHANGED
@@ -1,35 +1,52 @@
|
|
1
|
-
0.
|
2
|
-
---
|
3
|
-
*
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
*
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
*
|
12
|
-
*
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
*
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
*
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
1
|
+
1.0.0
|
2
|
+
---
|
3
|
+
* Improve coverage and readability of README [philostler#26]
|
4
|
+
* Greatly increase test coverage [philostler#27]
|
5
|
+
* Refactor and greatly improve be_a_delayed_job matcher (now be_delayed) [philostler#24 & #25]
|
6
|
+
* Add implementation of status.total [matthargett & Kelly Felkins#32 & #39]
|
7
|
+
* Fix Rubinius build [petergoldstein#38]
|
8
|
+
* Remove have_enqueued_jobs matcher [philostler#37]
|
9
|
+
* Travis - Ruby 2.1.0, fix Rubinius build [petergoldstein#35]
|
10
|
+
* Prepare for RSpec 3.x [petergoldstein#34]
|
11
|
+
* Print warning when used in development mode [mperham & philostler#33]
|
12
|
+
* Add helper for testing retries exhausted block [Noreaster76#31]
|
13
|
+
* Allow to use [general matchers](https://www.relishapp.com/rspec/rspec-mocks/v/2-14/docs/argument-matchers/general-matchers) in have_enqueued_job [johanneswuerbach#30]
|
14
|
+
* Loosen RSpec dependency [philostler#23]
|
15
|
+
* Add delay extension matchers [sosaucily#22]
|
16
|
+
* Update coveralls development dependency to version 0.7.x [philostler]
|
17
|
+
|
18
|
+
0.5.1
|
19
|
+
---
|
20
|
+
* Allows Sidekiq::Batch support to work with Mocha as well RSpec stubbing [noiseunion#20]
|
21
|
+
|
22
|
+
0.5.0
|
23
|
+
---
|
24
|
+
* Adds stub support for Sidekiq::Batch [kmayer#17]
|
25
|
+
|
26
|
+
0.4.0
|
27
|
+
---
|
28
|
+
* Bug fix for matcher failure if sidekiq_options were defined as strings vs symbols [mhuffnagle#16 & philostler]
|
29
|
+
* Matcher tests (partial coverage) added [mhuffnagle#16 & philostler]
|
30
|
+
|
31
|
+
0.3.0
|
32
|
+
---
|
33
|
+
* Removed restriction on needing to use sidekiq-middleware with be_unique matcher [philostler#4]
|
34
|
+
* Ensure RSpec.configure is defined on loading rspec/sidekiq/matchers [centaure#3]
|
35
|
+
|
36
|
+
0.2.2
|
37
|
+
---
|
38
|
+
* Matcher ```be_retryable false``` not producing correct output description [philostler]
|
39
|
+
|
40
|
+
0.2.1
|
41
|
+
---
|
42
|
+
* Removed debug #puts [philostler]
|
43
|
+
|
44
|
+
0.2.0
|
45
|
+
---
|
46
|
+
* New #have_enqueued_job matcher [philostler]
|
47
|
+
* Improved #have_enqueued_jobs description [philostler]
|
48
|
+
* Minor documentation updates [philostler]
|
49
|
+
|
50
|
+
0.1.0
|
51
|
+
---
|
52
|
+
* Initial release [philostler]
|
data/Gemfile
CHANGED
data/LICENSE
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2013 Phil Ostler
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
|
-
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
8
|
-
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2013 Phil Ostler
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
|
+
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
8
|
+
|
9
9
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,135 +1,181 @@
|
|
1
|
-
# RSpec for Sidekiq
|
2
|
-
|
3
|
-
[![RubyGems][gem_version_badge]][ruby_gems]
|
4
|
-
[![Code Climate][code_climate_badge]][code_climate]
|
5
|
-
[![Travis CI][travis_ci_badge]][travis_ci]
|
6
|
-
[![Coveralls][coveralls_badge]][coveralls]
|
7
|
-
[![Gemnasium][gemnasium_badge]][gemnasium]
|
8
|
-
[![coderwall][coderwall_badge]][coderwall]
|
9
|
-
|
10
|
-
*Simple testing of Sidekiq jobs via a collection of matchers and
|
11
|
-
|
12
|
-
[RubyGems][ruby_gems] |
|
13
|
-
[Code Climate][code_climate] |
|
14
|
-
[GitHub][github] |
|
15
|
-
[Travis CI][travis_ci] |
|
16
|
-
[Coveralls][coveralls] |
|
17
|
-
[Gemnasium][gemnasium] |
|
18
|
-
[RubyDoc][ruby_doc] |
|
19
|
-
[Ruby Toolbox][ruby_toolbox]
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
## Configuration
|
35
|
-
If you wish to modify the default behaviour, add the following to your ```spec_helper.rb``` file
|
36
|
-
```ruby
|
37
|
-
RSpec::Sidekiq.configure do |config|
|
38
|
-
# Clears all job queues before each example
|
39
|
-
config.clear_all_enqueued_jobs =
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
*
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
expect(
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
```
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
# ...or
|
93
|
-
expect(AwesomeJob).to
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
```
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
1
|
+
# RSpec for Sidekiq
|
2
|
+
|
3
|
+
[![RubyGems][gem_version_badge]][ruby_gems]
|
4
|
+
[![Code Climate][code_climate_badge]][code_climate]
|
5
|
+
[![Travis CI][travis_ci_badge]][travis_ci]
|
6
|
+
[![Coveralls][coveralls_badge]][coveralls]
|
7
|
+
[![Gemnasium][gemnasium_badge]][gemnasium]
|
8
|
+
[![coderwall][coderwall_badge]][coderwall]
|
9
|
+
|
10
|
+
*Simple testing of Sidekiq jobs via a collection of matchers and helpers*
|
11
|
+
|
12
|
+
[RubyGems][ruby_gems] |
|
13
|
+
[Code Climate][code_climate] |
|
14
|
+
[GitHub][github] |
|
15
|
+
[Travis CI][travis_ci] |
|
16
|
+
[Coveralls][coveralls] |
|
17
|
+
[Gemnasium][gemnasium] |
|
18
|
+
[RubyDoc][ruby_doc] |
|
19
|
+
[Ruby Toolbox][ruby_toolbox]
|
20
|
+
|
21
|
+
[Jump to Matchers »](#matchers) | [Jump to Helpers »](#helpers)
|
22
|
+
|
23
|
+
## Installation
|
24
|
+
```ruby
|
25
|
+
# Gemfile
|
26
|
+
group :test do
|
27
|
+
gem "rspec-sidekiq"
|
28
|
+
end
|
29
|
+
```
|
30
|
+
rspec-sidekiq requires ```sidekiq/testing``` by default so there is no need to include the line ```require "sidekiq/testing"``` inside your ```spec_helper.rb```.
|
31
|
+
|
32
|
+
*IMPORTANT! This has the effect of not pushing enqueued jobs to Redis but to a ```job``` array to enable testing ([see the FAQ & Troubleshooting Wiki page][rspec_sidekiq_wiki_faq_&_troubleshooting]). Thus, only include ```gem "rspec-sidekiq"``` in environments where this behaviour is required, such as the ```test``` group.*
|
33
|
+
|
34
|
+
## Configuration
|
35
|
+
If you wish to modify the default behaviour, add the following to your ```spec_helper.rb``` file
|
36
|
+
```ruby
|
37
|
+
RSpec::Sidekiq.configure do |config|
|
38
|
+
# Clears all job queues before each example
|
39
|
+
config.clear_all_enqueued_jobs = true # default => true
|
40
|
+
|
41
|
+
# Whether to use terminal colours when outputting messages
|
42
|
+
config.enable_terminal_colours = true # default => true
|
43
|
+
|
44
|
+
# Warn when jobs are not enqueued to Redis but to a job array
|
45
|
+
config.warn_when_jobs_not_processed_by_sidekiq = true # default => true
|
46
|
+
end
|
47
|
+
```
|
48
|
+
|
49
|
+
## Matchers
|
50
|
+
* [be_delayed](#be_delayed)
|
51
|
+
* [be_processed_in](#be_processed_in)
|
52
|
+
* [be_retryable](#be_retryable)
|
53
|
+
* [be_unique](#be_unique)
|
54
|
+
* [have_enqueued_job](#have_enqueued_job)
|
55
|
+
* ~~[have_enqueued_jobs](#have_enqueued_jobs)~~
|
56
|
+
|
57
|
+
### be_delayed
|
58
|
+
*Describes a method that should be invoked asynchronously (See [Sidekiq Delayed Extensions][sidekiq_wiki_delayed_extensions])*
|
59
|
+
```ruby
|
60
|
+
Object.delay.is_nil? # delay
|
61
|
+
expect(Object.method :is_nil?).to be_delayed
|
62
|
+
Object.delay.is_a? Object # delay with argument
|
63
|
+
expect(Object.method :is_a?).to be_delayed(Object)
|
64
|
+
|
65
|
+
Object.delay_for(1.hour).is_nil? # delay for
|
66
|
+
expect(Object.method :is_nil?).to be_delayed.for 1.hour
|
67
|
+
Object.delay_for(1.hour).is_a? Object # delay for with argument
|
68
|
+
expect(Object.method :is_a?).to be_delayed(Object).for 1.hour
|
69
|
+
|
70
|
+
Object.delay_until(1.hour.from_now).is_nil? # delay until
|
71
|
+
expect(Object.method :is_nil?).to be_delayed.until 1.hour.from_now
|
72
|
+
Object.delay_until(1.hour.from_now).is_a? Object # delay until with argument
|
73
|
+
expect(Object.method :is_a?).to be_delayed(Object).until 1.hour.from_now
|
74
|
+
```
|
75
|
+
|
76
|
+
### be_processed_in
|
77
|
+
*Describes the queue that a job should be processed in*
|
78
|
+
```ruby
|
79
|
+
sidekiq_options queue: :download
|
80
|
+
# test with...
|
81
|
+
expect(AwesomeJob).to be_processed_in :download # or
|
82
|
+
it { should be_processed_in :download }
|
83
|
+
```
|
84
|
+
|
85
|
+
### be_retryable
|
86
|
+
*Describes if a job should retry when there is a failure in it's execution*
|
87
|
+
```ruby
|
88
|
+
sidekiq_options retry: 5
|
89
|
+
# test with...
|
90
|
+
expect(AwesomeJob).to be_retryable true # or
|
91
|
+
it { should be_retryable true }
|
92
|
+
# ...or alternatively specifiy the number of times it should be retried
|
93
|
+
expect(AwesomeJob).to be_retryable 5 # or
|
94
|
+
it { should be_retryable 5 }
|
95
|
+
# ...or when it should not retry
|
96
|
+
expect(AwesomeJob).to be_retryable false # or
|
97
|
+
it { should be_retryable false }
|
98
|
+
```
|
99
|
+
|
100
|
+
### be_unique
|
101
|
+
*Describes when a job should be unique within it's queue*
|
102
|
+
```ruby
|
103
|
+
sidekiq_options unique: true
|
104
|
+
# test with...
|
105
|
+
expect(AwesomeJob).to be_unique
|
106
|
+
it { should be_unique }
|
107
|
+
```
|
108
|
+
|
109
|
+
### have_enqueued_job
|
110
|
+
*Describes that there should be an enqueued job with the specified arguments*
|
111
|
+
```ruby
|
112
|
+
Awesomejob.perform_async "Awesome", true
|
113
|
+
# test with...
|
114
|
+
expect(AwesomeJob).to have_enqueued_job("Awesome", true)
|
115
|
+
```
|
116
|
+
|
117
|
+
### ~~have_enqueued_jobs~~
|
118
|
+
*Removed. [See the FAQ & Troubleshooting Wiki page][rspec_sidekiq_wiki_faq_&_troubleshooting] for alternative and more information*
|
119
|
+
|
120
|
+
## Example matcher usage
|
121
|
+
```ruby
|
122
|
+
require "spec_helper"
|
123
|
+
|
124
|
+
describe AwesomeJob do
|
125
|
+
it { should be_processed_in :my_queue }
|
126
|
+
it { should be_retryable 5 }
|
127
|
+
it { should be_unique }
|
128
|
+
|
129
|
+
it "enqueues another awesome job" do
|
130
|
+
subject.perform
|
131
|
+
|
132
|
+
expect(AnotherAwesomeJob).to have_enqueued_job("Awesome", true)
|
133
|
+
end
|
134
|
+
end
|
135
|
+
```
|
136
|
+
|
137
|
+
## Helpers
|
138
|
+
* [Batches](#batches)
|
139
|
+
* [within_sidekiq_retries_exhausted_block](#within_sidekiq_retries_exhausted_block)
|
140
|
+
|
141
|
+
### Batches
|
142
|
+
If you are using Sidekiq Batches ([Sidekiq Pro feature][sidekiq_wiki_batches]), rspec-sidekiq replaces the implementation (using the NullObject pattern) enabling testing without a Redis instance. Mocha and RSpec stubbing is supported here.
|
143
|
+
|
144
|
+
### within_sidekiq_retries_exhausted_block
|
145
|
+
```ruby
|
146
|
+
sidekiq_retries_exhausted do |msg|
|
147
|
+
bar('hello')
|
148
|
+
end
|
149
|
+
# test with...
|
150
|
+
FooClass.within_sidekiq_retries_exhausted_block {
|
151
|
+
expect(FooClass).to receive(:bar).with("hello")
|
152
|
+
}
|
153
|
+
```
|
154
|
+
|
155
|
+
## Testing
|
156
|
+
```bundle exec rspec spec```
|
157
|
+
|
158
|
+
## Contribute
|
159
|
+
Please do! If there's a feature missing that you'd love to see then get in on the action!
|
160
|
+
|
161
|
+
Issues/Pull Requests/Comments all welcome...
|
162
|
+
|
163
|
+
[code_climate]: https://codeclimate.com/github/philostler/rspec-sidekiq
|
164
|
+
[code_climate_badge]: https://codeclimate.com/github/philostler/rspec-sidekiq.png
|
165
|
+
[coderwall]: https://coderwall.com/philostler
|
166
|
+
[coderwall_badge]: https://api.coderwall.com/philostler/endorsecount.png
|
167
|
+
[coveralls]: https://coveralls.io/r/philostler/rspec-sidekiq
|
168
|
+
[coveralls_badge]: https://coveralls.io/repos/philostler/rspec-sidekiq/badge.png?branch=master
|
169
|
+
[gem_version_badge]: https://badge.fury.io/rb/rspec-sidekiq.png
|
170
|
+
[gemnasium]: https://gemnasium.com/philostler/rspec-sidekiq
|
171
|
+
[gemnasium_badge]: https://gemnasium.com/philostler/rspec-sidekiq.png
|
172
|
+
[github]: http://github.com/philostler/rspec-sidekiq
|
173
|
+
[ruby_doc]: http://rubydoc.info/github/philostler/rspec-sidekiq/master/frames
|
174
|
+
[ruby_gems]: http://rubygems.org/gems/rspec-sidekiq
|
175
|
+
[ruby_toolbox]: http://www.ruby-toolbox.com/projects/rspec-sidekiq
|
176
|
+
[travis_ci]: http://travis-ci.org/philostler/rspec-sidekiq
|
177
|
+
[travis_ci_badge]: https://secure.travis-ci.org/philostler/rspec-sidekiq.png
|
178
|
+
|
179
|
+
[rspec_sidekiq_wiki_faq_&_troubleshooting]: https://github.com/philostler/rspec-sidekiq/wiki/FAQ-&-Troubleshooting
|
180
|
+
[sidekiq_wiki_batches]: https://github.com/mperham/sidekiq/wiki/Batches
|
181
|
+
[sidekiq_wiki_delayed_extensions]: https://github.com/mperham/sidekiq/wiki/Delayed-Extensions
|