diff options
author | Vsevolod Romashov <7@7vn.ru> | 2012-04-28 00:15:51 +0400 |
---|---|---|
committer | Vsevolod Romashov <7@7vn.ru> | 2012-04-28 00:15:51 +0400 |
commit | 9d630d4368a2a8c0d7f1797486f1c3ad37e03185 (patch) | |
tree | 97b5fb63337e5b40ef889f25fe3b9cba5eb7db3b /railties/test/queueing | |
parent | cd50b60431881b808d596f394befd38a2d453603 (diff) | |
download | rails-9d630d4368a2a8c0d7f1797486f1c3ad37e03185.tar.gz rails-9d630d4368a2a8c0d7f1797486f1c3ad37e03185.tar.bz2 rails-9d630d4368a2a8c0d7f1797486f1c3ad37e03185.zip |
fixes run order in Rails::Queueing::TestQueue
Diffstat (limited to 'railties/test/queueing')
-rw-r--r-- | railties/test/queueing/test_queue_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/railties/test/queueing/test_queue_test.rb b/railties/test/queueing/test_queue_test.rb index de30e8cffd..46c6a1dc82 100644 --- a/railties/test/queueing/test_queue_test.rb +++ b/railties/test/queueing/test_queue_test.rb @@ -25,6 +25,19 @@ class TestQueueTest < ActiveSupport::TestCase assert_equal [job], @queue.contents end + def test_order + time1 = time2 = nil + + job1 = Job.new(1) { time1 = Time.now } + job2 = Job.new(2) { time2 = Time.now } + + @queue.push job1 + @queue.push job2 + @queue.drain + + assert time1 < time2, "Jobs run in the same order they were added" + end + def test_drain t = nil ran = false |