rspec-sidekiq 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzczMjhhM2ViNmUyYTRhYzNiNjljOTNkNWRjYjU4Mjk3NmVkNzg4Yw==
4
+ ODc2ZWI3NTdmZjk2MTY3N2I4YmMyNzYxOTQ2MjE4NTY2NWE1OGQ4Yw==
5
5
  data.tar.gz: !binary |-
6
- N2M1OTMxM2NhYTc2MjY0NzAyMDkzMzdiYmVhYzAwNjlkZWRiZjNlMQ==
6
+ Zjk0MjBkYTY4NTNiZjlkNWZlZTRhZGVkNzRhYWM3YjcyMWQyYmRjZg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MTNkNDU5OWEzZTdkZWE4Mjc4OTQ3OTQwNGEzZDNmZjU1YjhhZGI3YjhlYzhh
10
- ZjZlNzIxYmQwZmNhMWY3ZGY0Y2E0NzI4NWFhZjkwMDk0Nzk1ZmI4NjM3YjI4
11
- NzEzZTllMTVmMDE0ZDc1Yzc5NjJmZmE2YWZhOWQzMzVkM2JjZmY=
9
+ NmNmNDZiYzFkZGU4OWRjNWQ0MjdiZDIwOTY5YzA1YzY4OWI5ZDlkZTQ3NGM3
10
+ ZmM3NGQ0MzE3NjNhMmQ2ZTE0NzY0NWVhMWQyOTc0OWQ3YTVkODE1N2RmMTIz
11
+ ZWQyMmYyY2Q5OTAyOGM3NDEwNDhmYjRhMDA2MWVmNGMwNGNlNjA=
12
12
  data.tar.gz: !binary |-
13
- NjNmNDNhNjNiZmM4MTE1MjNhN2JlNDI0OTZhNDhlMzZkNWE0Mjg3ZGMyMTJh
14
- YTg3NjNmZGVhOWQxNDYwZDQyOTc5MWIzMDczNTc5ODBlMWM0M2ZmYmNlMGU3
15
- ZGViNmRjZDE3ZDIxZGIwNTI5OTI4NjdhNTBjOGVkYWQ2ZTRjMWU=
13
+ YTYxZDBhYmJlOTg5MTA4YjVkZGU0ZTM4NjE4OTg4MzlmN2ZmYzBjNzZjZDk4
14
+ OTM1NGI3YmE1MmQ3YWViZTdkMWRhOTFjOGNjZjA0ZjQ1NmUxN2QyYmJiZWVl
15
+ MGY2NjNhMmE1NTUwNjk5Nzk1YmQwMjc4NTU3NDUwZWZkMzQ4MDk=
data/CHANGES.md CHANGED
@@ -1,17 +1,22 @@
1
+ 0.3.0
2
+ ---
3
+ * Removed restriction on needing to use sidekiq-middleware with be_unique matcher [philostler#4]
4
+ * Ensure RSpec.configure is defined on loading rspec/sidekiq/matchers [centaure#3]
5
+
1
6
  0.2.2
2
7
  ---
3
- * Matcher ```be_retryable false``` not producing correct output description
8
+ * Matcher ```be_retryable false``` not producing correct output description [philostler]
4
9
 
5
10
  0.2.1
6
11
  ---
7
- * Removed debug #puts
12
+ * Removed debug #puts [philostler]
8
13
 
9
14
  0.2.0
10
15
  ---
11
- * New #have_enqueued_job matcher
12
- # Improved #have_enqueued_jobs description
13
- * Minor documentation updates
16
+ * New #have_enqueued_job matcher [philostler]
17
+ * Improved #have_enqueued_jobs description [philostler]
18
+ * Minor documentation updates [philostler]
14
19
 
15
20
  0.1.0
16
21
  ---
17
- * Initial release
22
+ * Initial release [philostler]
data/README.md CHANGED
@@ -10,6 +10,7 @@ gem "rspec-sidekiq"
10
10
  There is no need to ```require "sidekiq/testing"``` when using rspec-sidekiq
11
11
 
12
12
  ## Configuration
13
+ If you wish to modify the default behaviour, add the following to your ```spec_helper.rb``` file
13
14
  ```ruby
14
15
  RSpec::Sidekiq.configure do |config|
15
16
  # Clears all job queues before each example
@@ -41,9 +42,11 @@ it { should be_retryable 5 } } # one liner
41
42
  expect(AwesomeJob).to be_retryable 5 # new expect syntax
42
43
  ```
43
44
 
44
- ### be_unique (Only available when using [sidekiq-middleware](https://github.com/krasnoukhov/sidekiq-middleware))
45
+ ### be_unique
45
46
  *Describes if the job should be unique within it's queue*
46
47
  ```ruby
48
+ sidekiq_options unique: true # job option
49
+
47
50
  it { should be_unique } } # one liner
48
51
  expect(AwesomeJob).to be_unique # new expect syntax
49
52
  ```
@@ -64,6 +67,23 @@ expect(AwesomeJob).to have(1).jobs
64
67
  expect(AwesomeJob).to have(1).enqueued.jobs
65
68
  ```
66
69
 
70
+ ## Example
71
+ ```ruby
72
+ require "spec_helper"
73
+
74
+ describe AwesomeJob do
75
+ it { should be_processed_in :download }
76
+ it { should be_retryable false }
77
+ it { should be_unique }
78
+
79
+ it "enqueues another awesome job" do
80
+ subject.perform
81
+
82
+ expect(AnotherAwesomeJob).to have_enqueued_job("Awesome", true)
83
+ end
84
+ end
85
+ ```
86
+
67
87
  ## Testing
68
88
  ```bundle exec rspec spec```
69
89
 
@@ -1,12 +1,10 @@
1
+ require "rspec/core"
1
2
  require "rspec/sidekiq/matchers/be_processed_in"
2
3
  require "rspec/sidekiq/matchers/be_retryable"
4
+ require "rspec/sidekiq/matchers/be_unique"
3
5
  require "rspec/sidekiq/matchers/have_enqueued_job"
4
6
  require "rspec/sidekiq/matchers/have_enqueued_jobs"
5
7
 
6
- if defined?(Sidekiq::Middleware::Client::UniqueJobs)
7
- require "rspec/sidekiq/matchers/be_unique"
8
- end
9
-
10
8
  RSpec.configure do |config|
11
9
  config.include RSpec::Sidekiq::Matchers
12
- end
10
+ end
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module Sidekiq
3
- VERSION = "0.2.2"
3
+ VERSION = "0.3.0"
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.2.2") }
6
+ expect_it { to eq("0.3.0") }
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.2.2
4
+ version: 0.3.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: 2013-03-28 00:00:00.000000000 Z
11
+ date: 2013-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec