rspec-sidekiq 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGES.md +11 -6
- data/README.md +21 -1
- data/lib/rspec/sidekiq/matchers.rb +3 -5
- 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
|
+
ODc2ZWI3NTdmZjk2MTY3N2I4YmMyNzYxOTQ2MjE4NTY2NWE1OGQ4Yw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Zjk0MjBkYTY4NTNiZjlkNWZlZTRhZGVkNzRhYWM3YjcyMWQyYmRjZg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NmNmNDZiYzFkZGU4OWRjNWQ0MjdiZDIwOTY5YzA1YzY4OWI5ZDlkZTQ3NGM3
|
10
|
+
ZmM3NGQ0MzE3NjNhMmQ2ZTE0NzY0NWVhMWQyOTc0OWQ3YTVkODE1N2RmMTIz
|
11
|
+
ZWQyMmYyY2Q5OTAyOGM3NDEwNDhmYjRhMDA2MWVmNGMwNGNlNjA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
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
|
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
|
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.
|
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-
|
11
|
+
date: 2013-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|