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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZWJhYzU3ZmMzNzNmNDVmZDVlZWFkZjkwMWZlZjBjNjVkM2RjOTRkNg==
4
+ ZjNmMWRlZTNlNDJkYTllMDg1YWRkZGRmMTBhNjIyNjA2NTAyZGNhNQ==
5
5
  data.tar.gz: !binary |-
6
- OTY2YWY0ZDU0ZTM5NDVlNTkwY2FhNTA1YzFlNDdlYjZkZThmNWU0Ng==
6
+ M2NjNzkyMTk4ZWZjYTVlN2I3MTQ2YzYzMjdjMDJjOTUxNzIzMjBiOQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YjA2ZGJiNjAzNmVmMDA5ZWRlOWMwMTM5OTNmMzNjMzU3OTllNjAzYTM2YTYx
10
- ODVkZTc4NDA5MmY3NjYyMjY5ZDM2N2JiY2QzMzY3N2U5ZjZlNzBmNzlmOTFm
11
- OWZkOTUzNDM3NmM3NmYyZDM3M2UzYjRhYzgzNDNjNzU1ZjI3NzE=
9
+ NDVhZjc3NzFkNDM4NjNhYmZiNTdiMzc1MDQ2YTY0YTQ1Mzc5MjE1ZmZjZWM2
10
+ MjRmNmQ1MjVhOGJhMzQ5NGY5Y2ZmYTZhYTY2ZjE4ODA5MzFhOWMzNzQ3YzY0
11
+ ZTVkZTY4ZjAxZTAwYWQ0NDczNzFjNWJiYmMzMzExNTczYTdjMmM=
12
12
  data.tar.gz: !binary |-
13
- ZjlhZDhjMmRhMmQ3NjkwZTQxMzA5ZDA1MjBkMTRjOGFjOTA0ODU1OTM4NzRm
14
- MmNlNDE3MmQ5YjliNzQyNzU1OGNjY2Q4M2E4YTg1MzY2ZDNkY2UwZjhiNDYy
15
- YTI5ZDk3Y2NjNTEzZjIzNWQ2N2VhNzI0MWRlYTliMDlhNDEzZTY=
13
+ M2U1NmQ1NjZlMGZhYzE1MDZjYjc1MzhiYjE2ZGQxNTNmNmNlZGRhNzNiYTE1
14
+ NjYxZTQ1MjM4MjBjNzc3MmNlMTlkODEwNGU3MGE5MDk1MWM1ZDQ3ZTRmNGQ3
15
+ YTcxOWMxMmMzZWRhNjcyNzQ2Y2M2NmM1YjAzNzg0NGUzYWI1MzI=
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ 0.5.1
2
+ ---
3
+ * Allows Sidekiq::Batch support to work with Mocha as well RSpec stubbing [noiseunion#20]
4
+
1
5
  0.5.0
2
6
  ---
3
7
  * Adds stub support for Sidekiq::Batch [kmayer#17]
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
@@ -26,8 +26,19 @@ if defined?(Sidekiq::Batch)
26
26
 
27
27
  RSpec.configure do |config|
28
28
  config.before(:each) do
29
- Sidekiq::Batch.stub(:new) { RSpec::Sidekiq::NullBatch.new }
30
- Sidekiq::Batch::Status.stub(:new) { RSpec::Sidekiq::NullStatus.new }
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
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module Sidekiq
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.1"
4
4
  end
5
5
  end
@@ -3,5 +3,5 @@ require "spec_helper"
3
3
  describe "Version" do
4
4
  subject { RSpec::Sidekiq::VERSION }
5
5
 
6
- expect_it { to eq("0.5.0") }
6
+ expect_it { to eq("0.5.1") }
7
7
  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.0
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-02 00:00:00.000000000 Z
11
+ date: 2013-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec