resque_spec 0.12.5 → 0.12.6

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.
data/README.md CHANGED
@@ -349,6 +349,7 @@ Contributors
349
349
  * @jeffdeville (Jeff Deville) :Resque.size
350
350
  * @opinel (Frank Wambutt) :Fix DST problem in `have\_scheduled`
351
351
  * @lukemelia (Luke Melia) :Add `times` chained matcher
352
+ * @heelhook (Pablo Fernandez) :Add `have_queue_size_of_at_least` and `have_schedule_size_of_at_least` matchers
352
353
 
353
354
  Copyright
354
355
  =========
@@ -84,6 +84,26 @@ RSpec::Matchers.define :have_queue_size_of do |size|
84
84
  end
85
85
  end
86
86
 
87
+ RSpec::Matchers.define :have_queue_size_of_at_least do |size|
88
+ extend InQueueHelper
89
+
90
+ match do |actual|
91
+ queue(actual).size >= size
92
+ end
93
+
94
+ failure_message_for_should do |actual|
95
+ "expected that #{actual} would have at least #{size} entries queued, but got #{queue(actual).size} instead"
96
+ end
97
+
98
+ failure_message_for_should_not do |actual|
99
+ "expected that #{actual} would not have at least #{size} entries queued, but got #{queue(actual).size} instead"
100
+ end
101
+
102
+ description do
103
+ "have a queue size of at least #{size}"
104
+ end
105
+ end
106
+
87
107
  RSpec::Matchers.define :have_scheduled do |*expected_args|
88
108
  chain :at do |timestamp|
89
109
  @interval = nil
@@ -166,3 +186,21 @@ RSpec::Matchers.define :have_schedule_size_of do |size|
166
186
  "have schedule size of #{size}"
167
187
  end
168
188
  end
189
+
190
+ RSpec::Matchers.define :have_schedule_size_of_at_least do |size|
191
+ match do |actual|
192
+ ResqueSpec.schedule_for(actual).size >= size
193
+ end
194
+
195
+ failure_message_for_should do |actual|
196
+ "expected that #{actual} would have at least #{size} scheduled entries, but got #{ResqueSpec.schedule_for(actual).size} instead"
197
+ end
198
+
199
+ failure_message_for_should_not do |actual|
200
+ "expected that #{actual} would have at least #{size} scheduled entries."
201
+ end
202
+
203
+ description do
204
+ "have schedule size of #{size}"
205
+ end
206
+ end
@@ -1,3 +1,3 @@
1
1
  module ResqueSpec
2
- VERSION = "0.12.5"
2
+ VERSION = "0.12.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.5
4
+ version: 0.12.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-05 00:00:00.000000000 Z
12
+ date: 2012-11-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: resque