rspec-sidekiq 2.0.0.beta → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +5 -0
- data/README.md +22 -22
- data/lib/rspec/sidekiq/batch.rb +0 -1
- data/lib/rspec/sidekiq/configuration.rb +0 -1
- data/lib/rspec/sidekiq/helpers/within_sidekiq_retries_exhausted_block.rb +0 -1
- data/lib/rspec/sidekiq/helpers.rb +0 -1
- data/lib/rspec/sidekiq/matchers/be_delayed.rb +13 -12
- data/lib/rspec/sidekiq/matchers/be_processed_in.rb +5 -5
- data/lib/rspec/sidekiq/matchers/be_retryable.rb +9 -9
- data/lib/rspec/sidekiq/matchers/be_unique.rb +4 -4
- data/lib/rspec/sidekiq/matchers/have_enqueued_job.rb +3 -5
- data/lib/rspec/sidekiq/matchers.rb +0 -1
- data/lib/rspec/sidekiq/sidekiq.rb +0 -1
- data/lib/rspec/sidekiq/version.rb +1 -2
- data/lib/rspec-sidekiq.rb +0 -1
- data/rspec-sidekiq.gemspec +3 -3
- data/spec/rspec/sidekiq/batch_spec.rb +1 -2
- data/spec/rspec/sidekiq/helpers/retries_exhausted_spec.rb +1 -2
- data/spec/rspec/sidekiq/matchers/be_delayed_spec.rb +1 -2
- data/spec/rspec/sidekiq/matchers/be_processed_in_spec.rb +1 -2
- data/spec/rspec/sidekiq/matchers/be_retryable_spec.rb +1 -2
- data/spec/rspec/sidekiq/matchers/be_unique_spec.rb +4 -5
- data/spec/rspec/sidekiq/matchers/have_enqueued_job_spec.rb +1 -2
- data/spec/rspec/sidekiq/sidekiq_spec.rb +1 -2
- data/spec/rspec/sidekiq/version_spec.rb +2 -3
- data/spec/spec_helper.rb +1 -11
- data/spec/support/factories.rb +0 -1
- data/spec/support/init.rb +0 -1
- data/spec/support/test_worker.rb +0 -1
- data/spec/support/test_worker_alternative.rb +0 -1
- metadata +24 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76cd53af3be89c34df72acb829234afa380827dc
|
4
|
+
data.tar.gz: f7f2fbaa2586f84587592824df13dab2fc783523
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ebf9b0763ade30bc300c29149e030b2d28cfeb0cb8d59365bcb5fa9b3de76bd32b8a1c5d40829f3e431f120250d566e6e1085676c01ed0dcc4040f7bab8a4ec
|
7
|
+
data.tar.gz: 4e5a37a9b4347167304d6397099ad2b0cfa0db852be3d46fb27c8d1b31c1905ab72073929bb30d7f1a6e13dafbbe891fc6be35e1dab965ca6a19789abc785ddd
|
data/CHANGES.md
CHANGED
data/README.md
CHANGED
@@ -23,7 +23,7 @@
|
|
23
23
|
```ruby
|
24
24
|
# Gemfile
|
25
25
|
group :test do
|
26
|
-
gem
|
26
|
+
gem 'rspec-sidekiq'
|
27
27
|
end
|
28
28
|
```
|
29
29
|
rspec-sidekiq requires ```sidekiq/testing``` by default so there is no need to include the line ```require "sidekiq/testing"``` inside your ```spec_helper.rb```.
|
@@ -77,7 +77,7 @@ expect(Object.method :is_a?).to be_delayed(Object).until 1.hour.from_now
|
|
77
77
|
sidekiq_options queue: :download
|
78
78
|
# test with...
|
79
79
|
expect(AwesomeJob).to be_processed_in :download # or
|
80
|
-
it {
|
80
|
+
it { is_expected.to be_processed_in :download }
|
81
81
|
```
|
82
82
|
|
83
83
|
### be_retryable
|
@@ -86,13 +86,13 @@ it { should be_processed_in :download }
|
|
86
86
|
sidekiq_options retry: 5
|
87
87
|
# test with...
|
88
88
|
expect(AwesomeJob).to be_retryable true # or
|
89
|
-
it {
|
89
|
+
it { is_expected.to be_retryable true }
|
90
90
|
# ...or alternatively specifiy the number of times it should be retried
|
91
91
|
expect(AwesomeJob).to be_retryable 5 # or
|
92
|
-
it {
|
92
|
+
it { is_expected.to be_retryable 5 }
|
93
93
|
# ...or when it should not retry
|
94
94
|
expect(AwesomeJob).to be_retryable false # or
|
95
|
-
it {
|
95
|
+
it { is_expected.to be_retryable false }
|
96
96
|
```
|
97
97
|
|
98
98
|
### be_unique
|
@@ -101,37 +101,37 @@ it { should be_retryable false }
|
|
101
101
|
sidekiq_options unique: true
|
102
102
|
# test with...
|
103
103
|
expect(AwesomeJob).to be_unique
|
104
|
-
it {
|
104
|
+
it { is_expected.to be_unique }
|
105
105
|
```
|
106
106
|
|
107
107
|
### have_enqueued_job
|
108
108
|
*Describes that there should be an enqueued job with the specified arguments*
|
109
109
|
```ruby
|
110
|
-
Awesomejob.perform_async
|
110
|
+
Awesomejob.perform_async 'Awesome', true
|
111
111
|
# test with...
|
112
|
-
expect(AwesomeJob).to have_enqueued_job(
|
112
|
+
expect(AwesomeJob).to have_enqueued_job('Awesome', true)
|
113
113
|
```
|
114
114
|
|
115
115
|
## Example matcher usage
|
116
116
|
```ruby
|
117
|
-
require
|
117
|
+
require 'spec_helper'
|
118
118
|
|
119
119
|
describe AwesomeJob do
|
120
|
-
it {
|
121
|
-
it {
|
122
|
-
it {
|
120
|
+
it { is_expected.to be_processed_in :my_queue }
|
121
|
+
it { is_expected.to be_retryable 5 }
|
122
|
+
it { is_expected.to be_unique }
|
123
123
|
|
124
|
-
it
|
124
|
+
it 'enqueues another awesome job' do
|
125
125
|
subject.perform
|
126
126
|
|
127
|
-
expect(AnotherAwesomeJob).to have_enqueued_job(
|
127
|
+
expect(AnotherAwesomeJob).to have_enqueued_job('Awesome', true)
|
128
128
|
end
|
129
129
|
end
|
130
130
|
```
|
131
131
|
|
132
132
|
## Helpers
|
133
|
-
* [Batches](#batches)
|
134
|
-
* [within_sidekiq_retries_exhausted_block](#within_sidekiq_retries_exhausted_block)
|
133
|
+
* [Batches (Sidekiq Pro)](#batches)
|
134
|
+
* [`within_sidekiq_retries_exhausted_block`](#within_sidekiq_retries_exhausted_block)
|
135
135
|
|
136
136
|
### Batches
|
137
137
|
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,7 +143,7 @@ sidekiq_retries_exhausted do |msg|
|
|
143
143
|
end
|
144
144
|
# test with...
|
145
145
|
FooClass.within_sidekiq_retries_exhausted_block {
|
146
|
-
expect(FooClass).to receive(:bar).with(
|
146
|
+
expect(FooClass).to receive(:bar).with('hello')
|
147
147
|
}
|
148
148
|
```
|
149
149
|
|
@@ -156,18 +156,18 @@ Please do! If there's a feature missing that you'd love to see then get in on th
|
|
156
156
|
Issues/Pull Requests/Comments all welcome...
|
157
157
|
|
158
158
|
[code_climate]: https://codeclimate.com/github/philostler/rspec-sidekiq
|
159
|
-
[code_climate_badge]: https://codeclimate.com/github/philostler/rspec-sidekiq.
|
159
|
+
[code_climate_badge]: https://codeclimate.com/github/philostler/rspec-sidekiq.svg
|
160
160
|
[coveralls]: https://coveralls.io/r/philostler/rspec-sidekiq
|
161
|
-
[coveralls_badge]: https://
|
162
|
-
[gem_version_badge]: https://badge.fury.io/rb/rspec-sidekiq.
|
161
|
+
[coveralls_badge]: https://img.shields.io/coveralls/philostler/rspec-sidekiq.svg?branch=develop
|
162
|
+
[gem_version_badge]: https://badge.fury.io/rb/rspec-sidekiq.svg
|
163
163
|
[gemnasium]: https://gemnasium.com/philostler/rspec-sidekiq
|
164
|
-
[gemnasium_badge]: https://gemnasium.com/philostler/rspec-sidekiq.
|
164
|
+
[gemnasium_badge]: https://gemnasium.com/philostler/rspec-sidekiq.svg
|
165
165
|
[github]: http://github.com/philostler/rspec-sidekiq
|
166
166
|
[ruby_doc]: http://rubydoc.info/gems/rspec-sidekiq/frames
|
167
167
|
[ruby_gems]: http://rubygems.org/gems/rspec-sidekiq
|
168
168
|
[ruby_toolbox]: http://www.ruby-toolbox.com/projects/rspec-sidekiq
|
169
169
|
[travis_ci]: http://travis-ci.org/philostler/rspec-sidekiq
|
170
|
-
[travis_ci_badge]: https://travis-ci.org/philostler/rspec-sidekiq.svg?branch=
|
170
|
+
[travis_ci_badge]: https://travis-ci.org/philostler/rspec-sidekiq.svg?branch=develop
|
171
171
|
|
172
172
|
[rspec_sidekiq_wiki_faq_&_troubleshooting]: https://github.com/philostler/rspec-sidekiq/wiki/FAQ-&-Troubleshooting
|
173
173
|
[sidekiq_wiki_batches]: https://github.com/mperham/sidekiq/wiki/Batches
|
data/lib/rspec/sidekiq/batch.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
module RSpec
|
2
2
|
module Sidekiq
|
3
3
|
module Matchers
|
4
|
-
def be_delayed
|
5
|
-
BeDelayed.new
|
4
|
+
def be_delayed(*expected_arguments)
|
5
|
+
BeDelayed.new(*expected_arguments)
|
6
6
|
end
|
7
7
|
|
8
8
|
class BeDelayed
|
9
|
-
def initialize
|
9
|
+
def initialize(*expected_arguments)
|
10
10
|
@expected_arguments = expected_arguments
|
11
11
|
end
|
12
12
|
|
13
13
|
def description
|
14
|
-
description =
|
14
|
+
description = 'be delayed'
|
15
15
|
description += " for #{@expected_interval} seconds" if @expected_interval
|
16
16
|
description += " until #{@expected_time}" if @expected_time
|
17
17
|
description += " with arguments #{@expected_arguments}" unless @expected_arguments.empty?
|
@@ -22,40 +22,41 @@ module RSpec
|
|
22
22
|
"expected #{@expected_method.receiver}.#{@expected_method.name} to " + description
|
23
23
|
end
|
24
24
|
|
25
|
-
def for
|
25
|
+
def for(interval)
|
26
26
|
@expected_interval = interval
|
27
27
|
self
|
28
28
|
end
|
29
29
|
|
30
|
-
def matches?
|
30
|
+
def matches?(expected_method)
|
31
31
|
@expected_method = expected_method
|
32
32
|
|
33
33
|
find_job @expected_method, @expected_arguments do |job|
|
34
34
|
if @expected_interval
|
35
|
-
return job[
|
35
|
+
return job['at'].to_i == job['enqueued_at'].to_i + @expected_interval
|
36
36
|
elsif @expected_time
|
37
|
-
return job[
|
37
|
+
return job['at'].to_i == @expected_time.to_i
|
38
38
|
else
|
39
39
|
return true
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
|
43
|
+
false
|
44
44
|
end
|
45
45
|
|
46
46
|
def failure_message_when_negated
|
47
47
|
"expected #{@expected_method.receiver}.#{@expected_method.name} to not " + description
|
48
48
|
end
|
49
49
|
|
50
|
-
def until
|
50
|
+
def until(time)
|
51
51
|
@expected_time = time
|
52
52
|
self
|
53
53
|
end
|
54
54
|
|
55
55
|
private
|
56
|
-
|
56
|
+
|
57
|
+
def find_job(method, arguments, &block)
|
57
58
|
job = (::Sidekiq::Extensions::DelayedClass.jobs + ::Sidekiq::Extensions::DelayedModel.jobs + ::Sidekiq::Extensions::DelayedMailer.jobs).find do |job|
|
58
|
-
yaml = YAML.load(job[
|
59
|
+
yaml = YAML.load(job['args'].first)
|
59
60
|
@expected_method.receiver == yaml[0] && @expected_method.name == yaml[1] && (@expected_arguments <=> yaml[2]) == 0
|
60
61
|
end
|
61
62
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module RSpec
|
2
2
|
module Sidekiq
|
3
3
|
module Matchers
|
4
|
-
def be_processed_in
|
4
|
+
def be_processed_in(expected_queue)
|
5
5
|
BeProcessedIn.new expected_queue
|
6
6
|
end
|
7
7
|
|
8
8
|
class BeProcessedIn
|
9
|
-
def initialize
|
9
|
+
def initialize(expected_queue)
|
10
10
|
@expected_queue = expected_queue
|
11
11
|
end
|
12
12
|
|
@@ -18,9 +18,9 @@ module RSpec
|
|
18
18
|
"expected #{@klass} to be processed in the \"#{@expected_queue}\" queue but got \"#{@actual}\""
|
19
19
|
end
|
20
20
|
|
21
|
-
def matches?
|
22
|
-
@klass = job.
|
23
|
-
@actual = @klass.get_sidekiq_options[
|
21
|
+
def matches?(job)
|
22
|
+
@klass = job.is_a?(Class) ? job : job.class
|
23
|
+
@actual = @klass.get_sidekiq_options['queue']
|
24
24
|
@actual.to_s == @expected_queue.to_s
|
25
25
|
end
|
26
26
|
|
@@ -1,22 +1,22 @@
|
|
1
1
|
module RSpec
|
2
2
|
module Sidekiq
|
3
3
|
module Matchers
|
4
|
-
def be_retryable
|
4
|
+
def be_retryable(expected_retry)
|
5
5
|
BeRetryable.new expected_retry
|
6
6
|
end
|
7
7
|
|
8
8
|
class BeRetryable
|
9
|
-
def initialize
|
9
|
+
def initialize(expected_retry)
|
10
10
|
@expected_retry = expected_retry
|
11
11
|
end
|
12
12
|
|
13
13
|
def description
|
14
14
|
if @expected_retry.is_a?(Fixnum)
|
15
|
-
"retry #{@expected_retry} times"
|
15
|
+
"retry #{@expected_retry} times" # retry: 5
|
16
16
|
elsif @expected_retry
|
17
|
-
|
17
|
+
'retry the default number of times' # retry: true
|
18
18
|
else
|
19
|
-
|
19
|
+
'not retry' # retry: false
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -24,14 +24,14 @@ module RSpec
|
|
24
24
|
"expected #{@klass} to #{description} but got #{@actual}"
|
25
25
|
end
|
26
26
|
|
27
|
-
def matches?
|
28
|
-
@klass = job.
|
29
|
-
@actual = @klass.get_sidekiq_options[
|
27
|
+
def matches?(job)
|
28
|
+
@klass = job.is_a?(Class) ? job : job.class
|
29
|
+
@actual = @klass.get_sidekiq_options['retry']
|
30
30
|
@actual == @expected_retry
|
31
31
|
end
|
32
32
|
|
33
33
|
def failure_message_when_negated
|
34
|
-
"expected #{@klass} to not #{description}".gsub
|
34
|
+
"expected #{@klass} to not #{description}".gsub 'not not ', ''
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -7,16 +7,16 @@ module RSpec
|
|
7
7
|
|
8
8
|
class BeUnique
|
9
9
|
def description
|
10
|
-
|
10
|
+
'be unique in the queue'
|
11
11
|
end
|
12
12
|
|
13
13
|
def failure_message
|
14
14
|
"expected #{@klass} to be unique in the queue"
|
15
15
|
end
|
16
16
|
|
17
|
-
def matches?
|
18
|
-
@klass = job.
|
19
|
-
@actual = @klass.get_sidekiq_options[
|
17
|
+
def matches?(job)
|
18
|
+
@klass = job.is_a?(Class) ? job : job.class
|
19
|
+
@actual = @klass.get_sidekiq_options['unique']
|
20
20
|
[true, :all].include?(@actual)
|
21
21
|
end
|
22
22
|
|
@@ -1,12 +1,11 @@
|
|
1
1
|
module RSpec
|
2
2
|
module Sidekiq
|
3
3
|
module Matchers
|
4
|
-
def have_enqueued_job
|
4
|
+
def have_enqueued_job(*expected_arguments)
|
5
5
|
HaveEnqueuedJob.new expected_arguments
|
6
6
|
end
|
7
7
|
|
8
8
|
class HaveEnqueuedJob
|
9
|
-
|
10
9
|
attr_reader :klass, :expected_arguments, :actual
|
11
10
|
|
12
11
|
def initialize(expected_arguments)
|
@@ -18,13 +17,13 @@ module RSpec
|
|
18
17
|
end
|
19
18
|
|
20
19
|
def failure_message
|
21
|
-
"expected to have an enqueued #{klass} job with arguments #{expected_arguments}\n\n"
|
20
|
+
"expected to have an enqueued #{klass} job with arguments #{expected_arguments}\n\n" \
|
22
21
|
"found: #{actual}"
|
23
22
|
end
|
24
23
|
|
25
24
|
def matches?(klass)
|
26
25
|
@klass = klass
|
27
|
-
@actual = klass.jobs.map { |job| job[
|
26
|
+
@actual = klass.jobs.map { |job| job['args'] }
|
28
27
|
@actual.any? { |arguments| contain_exactly?(arguments) }
|
29
28
|
end
|
30
29
|
|
@@ -38,7 +37,6 @@ module RSpec
|
|
38
37
|
exactly = RSpec::Matchers::BuiltIn::ContainExactly.new(expected_arguments)
|
39
38
|
exactly.matches?(arguments)
|
40
39
|
end
|
41
|
-
|
42
40
|
end
|
43
41
|
end
|
44
42
|
end
|
data/lib/rspec-sidekiq.rb
CHANGED
data/rspec-sidekiq.gemspec
CHANGED
@@ -12,11 +12,11 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.description = 'Simple testing of Sidekiq jobs via a collection of matchers and helpers'
|
13
13
|
s.license = 'MIT'
|
14
14
|
|
15
|
-
s.add_dependency 'rspec', '>= 3.0.0'
|
15
|
+
s.add_dependency 'rspec', '~> 3.0', '>= 3.0.0'
|
16
16
|
s.add_dependency 'sidekiq', '>= 2.4.0'
|
17
17
|
|
18
|
-
s.add_development_dependency 'coveralls', '~> 0.7.
|
19
|
-
s.add_development_dependency 'fuubar', '>= 2.0.0'
|
18
|
+
s.add_development_dependency 'coveralls', '~> 0.7', '>= 0.7.0'
|
19
|
+
s.add_development_dependency 'fuubar', '~> 2.0', '>= 2.0.0'
|
20
20
|
|
21
21
|
s.files = Dir['.gitattributes'] +
|
22
22
|
Dir['.gitignore'] +
|
@@ -1,7 +1,6 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
require 'spec_helper'
|
3
2
|
|
4
|
-
describe RSpec::Sidekiq::Matchers::BeDelayed do
|
3
|
+
RSpec.describe RSpec::Sidekiq::Matchers::BeDelayed do
|
5
4
|
let(:delay_subject) { RSpec::Sidekiq::Matchers::BeDelayed.new }
|
6
5
|
let(:delay_with_arguments_subject) { RSpec::Sidekiq::Matchers::BeDelayed.new Object }
|
7
6
|
let(:delay_for_subject) { RSpec::Sidekiq::Matchers::BeDelayed.new.for 3600 }
|
@@ -1,7 +1,6 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
require 'spec_helper'
|
3
2
|
|
4
|
-
describe RSpec::Sidekiq::Matchers::BeProcessedIn do
|
3
|
+
RSpec.describe RSpec::Sidekiq::Matchers::BeProcessedIn do
|
5
4
|
let(:symbol_subject) { RSpec::Sidekiq::Matchers::BeProcessedIn.new :a_queue }
|
6
5
|
let(:symbol_worker) { create_worker queue: :a_queue }
|
7
6
|
let(:string_subject) { RSpec::Sidekiq::Matchers::BeProcessedIn.new 'a_queue' }
|
@@ -1,7 +1,6 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
require 'spec_helper'
|
3
2
|
|
4
|
-
describe RSpec::Sidekiq::Matchers::BeRetryable do
|
3
|
+
RSpec.describe RSpec::Sidekiq::Matchers::BeRetryable do
|
5
4
|
let(:specific_subject) { RSpec::Sidekiq::Matchers::BeRetryable.new 2 }
|
6
5
|
let(:specific_worker) { create_worker retry: 2 }
|
7
6
|
let(:default_subject) { RSpec::Sidekiq::Matchers::BeRetryable.new true }
|
@@ -1,7 +1,6 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
require 'spec_helper'
|
3
2
|
|
4
|
-
describe RSpec::Sidekiq::Matchers::BeUnique do
|
3
|
+
RSpec.describe RSpec::Sidekiq::Matchers::BeUnique do
|
5
4
|
shared_context 'a unique worker' do
|
6
5
|
before(:each) { subject.matches? @worker }
|
7
6
|
|
@@ -31,9 +30,9 @@ describe RSpec::Sidekiq::Matchers::BeUnique do
|
|
31
30
|
end
|
32
31
|
end
|
33
32
|
|
34
|
-
describe '#
|
33
|
+
describe '#failure_message_when_negated' do
|
35
34
|
it 'returns message' do
|
36
|
-
expect(subject.
|
35
|
+
expect(subject.failure_message_when_negated).to eq "expected #{@worker} to not be unique in the queue"
|
37
36
|
end
|
38
37
|
end
|
39
38
|
end
|
@@ -57,7 +56,7 @@ describe RSpec::Sidekiq::Matchers::BeUnique do
|
|
57
56
|
|
58
57
|
describe '#failure_message_when_negated' do
|
59
58
|
it 'returns message' do
|
60
|
-
expect(subject.failure_message_when_negated).to eq "expected #{worker} to not be unique in the queue"
|
59
|
+
expect(subject.failure_message_when_negated).to eq "expected #{@worker} to not be unique in the queue"
|
61
60
|
end
|
62
61
|
end
|
63
62
|
end
|
@@ -1,7 +1,6 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
require 'spec_helper'
|
3
2
|
|
4
|
-
describe RSpec::Sidekiq::Matchers::HaveEnqueuedJob do
|
3
|
+
RSpec.describe RSpec::Sidekiq::Matchers::HaveEnqueuedJob do
|
5
4
|
let(:argument_subject) { RSpec::Sidekiq::Matchers::HaveEnqueuedJob.new ['string', 1, true] }
|
6
5
|
let(:matcher_subject) { RSpec::Sidekiq::Matchers::HaveEnqueuedJob.new [be_a(String), be_a(Fixnum), true] }
|
7
6
|
let(:worker) { create_worker }
|
@@ -1,7 +1,6 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
require 'spec_helper'
|
3
2
|
|
4
|
-
describe RSpec::Sidekiq do
|
3
|
+
RSpec.describe RSpec::Sidekiq do
|
5
4
|
describe '#configure' do
|
6
5
|
it 'yields with configuration' do
|
7
6
|
expect { |block| RSpec::Sidekiq.configure(&block) }.to yield_with_args RSpec::Sidekiq.configuration
|
data/spec/spec_helper.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
require 'simplecov'
|
3
2
|
require 'coveralls'
|
4
3
|
|
@@ -14,16 +13,7 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
|
14
13
|
SimpleCov.start
|
15
14
|
|
16
15
|
RSpec.configure do |config|
|
17
|
-
config.
|
18
|
-
|
19
|
-
config.expect_with :rspec do |config|
|
20
|
-
config.syntax = :expect
|
21
|
-
end
|
16
|
+
config.disable_monkey_patching!
|
22
17
|
|
23
18
|
config.include RSpec::Sidekiq::Spec::Support::Factories
|
24
19
|
end
|
25
|
-
|
26
|
-
RSpec::Core::MemoizedHelpers.module_eval do
|
27
|
-
alias to should
|
28
|
-
alias to_not should_not
|
29
|
-
end
|
data/spec/support/factories.rb
CHANGED
data/spec/support/init.rb
CHANGED
data/spec/support/test_worker.rb
CHANGED
metadata
CHANGED
@@ -1,19 +1,22 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-sidekiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phil Ostler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.0'
|
17
20
|
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
22
|
version: 3.0.0
|
@@ -21,6 +24,9 @@ dependencies:
|
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.0'
|
24
30
|
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
32
|
version: 3.0.0
|
@@ -44,18 +50,27 @@ dependencies:
|
|
44
50
|
requirements:
|
45
51
|
- - "~>"
|
46
52
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.7
|
53
|
+
version: '0.7'
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 0.7.0
|
48
57
|
type: :development
|
49
58
|
prerelease: false
|
50
59
|
version_requirements: !ruby/object:Gem::Requirement
|
51
60
|
requirements:
|
52
61
|
- - "~>"
|
53
62
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.7
|
63
|
+
version: '0.7'
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 0.7.0
|
55
67
|
- !ruby/object:Gem::Dependency
|
56
68
|
name: fuubar
|
57
69
|
requirement: !ruby/object:Gem::Requirement
|
58
70
|
requirements:
|
71
|
+
- - "~>"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '2.0'
|
59
74
|
- - ">="
|
60
75
|
- !ruby/object:Gem::Version
|
61
76
|
version: 2.0.0
|
@@ -63,6 +78,9 @@ dependencies:
|
|
63
78
|
prerelease: false
|
64
79
|
version_requirements: !ruby/object:Gem::Requirement
|
65
80
|
requirements:
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '2.0'
|
66
84
|
- - ">="
|
67
85
|
- !ruby/object:Gem::Version
|
68
86
|
version: 2.0.0
|
@@ -123,9 +141,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
123
141
|
version: '0'
|
124
142
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
143
|
requirements:
|
126
|
-
- - "
|
144
|
+
- - ">="
|
127
145
|
- !ruby/object:Gem::Version
|
128
|
-
version:
|
146
|
+
version: '0'
|
129
147
|
requirements: []
|
130
148
|
rubyforge_project:
|
131
149
|
rubygems_version: 2.2.2
|