rspec-sidekiq 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGES.md +4 -0
- data/README.md +1 -1
- data/lib/rspec/sidekiq/batch.rb +13 -2
- data/lib/rspec/sidekiq/version.rb +1 -1
- data/spec/rspec/sidekiq/version_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjNmMWRlZTNlNDJkYTllMDg1YWRkZGRmMTBhNjIyNjA2NTAyZGNhNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
M2NjNzkyMTk4ZWZjYTVlN2I3MTQ2YzYzMjdjMDJjOTUxNzIzMjBiOQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDVhZjc3NzFkNDM4NjNhYmZiNTdiMzc1MDQ2YTY0YTQ1Mzc5MjE1ZmZjZWM2
|
10
|
+
MjRmNmQ1MjVhOGJhMzQ5NGY5Y2ZmYTZhYTY2ZjE4ODA5MzFhOWMzNzQ3YzY0
|
11
|
+
ZTVkZTY4ZjAxZTAwYWQ0NDczNzFjNWJiYmMzMzExNTczYTdjMmM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
M2U1NmQ1NjZlMGZhYzE1MDZjYjc1MzhiYjE2ZGQxNTNmNmNlZGRhNzNiYTE1
|
14
|
+
NjYxZTQ1MjM4MjBjNzc3MmNlMTlkODEwNGU3MGE5MDk1MWM1ZDQ3ZTRmNGQ3
|
15
|
+
YTcxOWMxMmMzZWRhNjcyNzQ2Y2M2NmM1YjAzNzg0NGUzYWI1MzI=
|
data/CHANGES.md
CHANGED
data/README.md
CHANGED
@@ -29,7 +29,7 @@ end
|
|
29
29
|
|
30
30
|
*This has the effect of not pushing enqueued jobs to Redis but to a ```job``` array to enable testing ([see Sidekiq's testing wiki](https://github.com/mperham/sidekiq/wiki/Testing)). Thus, only include ```gem "rspec-sidekiq"``` in environments where this behaviour is required, such as the ```test``` group.*
|
31
31
|
|
32
|
-
If you are using Sidekiq Batches ([Sidekiq Pro feature](https://github.com/mperham/sidekiq/wiki/Batches)), ```rspec-sidekiq``` replaces the implementation (using the NullObject pattern) enabling testing without a Redis instance.
|
32
|
+
If you are using Sidekiq Batches ([Sidekiq Pro feature](https://github.com/mperham/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.
|
33
33
|
|
34
34
|
## Configuration
|
35
35
|
If you wish to modify the default behaviour, add the following to your ```spec_helper.rb``` file
|
data/lib/rspec/sidekiq/batch.rb
CHANGED
@@ -26,8 +26,19 @@ if defined?(Sidekiq::Batch)
|
|
26
26
|
|
27
27
|
RSpec.configure do |config|
|
28
28
|
config.before(:each) do
|
29
|
-
|
30
|
-
|
29
|
+
if mocked_with_mocha?
|
30
|
+
Sidekiq::Batch.stubs(:new) { RSpec::Sidekiq::NullBatch.new }
|
31
|
+
Sidekiq::Batch::Status.stubs(:new) { RSpec::Sidekiq::NullStatus.new }
|
32
|
+
else
|
33
|
+
Sidekiq::Batch.stub(:new) { RSpec::Sidekiq::NullBatch.new }
|
34
|
+
Sidekiq::Batch::Status.stub(:new) { RSpec::Sidekiq::NullStatus.new }
|
35
|
+
end
|
31
36
|
end
|
32
37
|
end
|
38
|
+
|
39
|
+
## Helpers ----------------------------------------------
|
40
|
+
|
41
|
+
def mocked_with_mocha?
|
42
|
+
Sidekiq::Batch.respond_to? :stubs
|
43
|
+
end
|
33
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-sidekiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phil Ostler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|