Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Clean up priority spec

  • Loading branch information...
commit 736992310e6000d2da2be8f4693704919ba3fac2 1 parent 757a614
@bkeepers bkeepers authored
Showing with 5 additions and 10 deletions.
  1. +5 −10 spec/shared_backend_spec.rb
View
15 spec/shared_backend_spec.rb
@@ -183,17 +183,12 @@ def create_job(opts = {})
end
it "should fetch jobs ordered by priority" do
- number_of_jobs = 10
- number_of_jobs.times { @backend.enqueue SimpleJob.new, rand(10) }
+ 10.times { @backend.enqueue SimpleJob.new, rand(10) }
jobs = @backend.find_available('worker', 10)
- ordered = true
- jobs[1..-1].each_index{ |i|
- if (jobs[i].priority > jobs[i+1].priority)
- ordered = false
- break
- end
- }
- ordered.should == true
+ jobs.size.should == 10
+ jobs.each_cons(2) do |a, b|
+ a.priority.should <= b.priority
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.