Skip to content
Browse files

do not depend on time

  • Loading branch information...
1 parent 3ca7b13 commit 673fe05899706e2e4eef28b6f749eab1b3df5d82 @tenderlove tenderlove committed Apr 27, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 railties/test/queueing/test_queue_test.rb
View
8 railties/test/queueing/test_queue_test.rb
@@ -26,16 +26,16 @@ def test_contents
end
def test_order
- time1 = time2 = nil
+ processed = []
- job1 = Job.new(1) { time1 = Time.now }
- job2 = Job.new(2) { time2 = Time.now }
+ job1 = Job.new(1) { processed << 1 }
+ job2 = Job.new(2) { processed << 2 }
@queue.push job1
@queue.push job2
@queue.drain
- assert time1 < time2, "Jobs run in the same order they were added"
+ assert_equal [1,2], processed
end
def test_drain

0 comments on commit 673fe05

Please sign in to comment.
Something went wrong with that request. Please try again.