Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

clean up access of schedule in tests

  • Loading branch information...
commit 6da09f49dcd3157d3a623b42a38cb845366c59c5 1 parent ca46fed
@yaauie yaauie authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 test/scheduler_hooks_test.rb
View
8 test/scheduler_hooks_test.rb
@@ -36,8 +36,8 @@ def setup
def test_schedule_job_that_can_reject_being_scheduled_but_doesnt
enqueue_time = Time.now + 12
Resque.enqueue_at(enqueue_time, JobThatCannotBeScheduledWithoutArguments.clean, :foo)
- assert_equal(1, Resque.redis.llen("delayed:#{enqueue_time.to_i}").to_i, "delayed queue should have one entry now")
- assert_equal(1, Resque.redis.zcard(:delayed_queue_schedule), "The delayed_queue_schedule should have 1 entry now")
+ assert_equal(1, Resque.delayed_timestamp_size(enqueue_time.to_i), "delayed queue should have one entry now")
+ assert_equal(1, Resque.delayed_queue_schedule_size, "The delayed_queue_schedule should have 1 entry now")
assert_equal(1, JobThatCannotBeScheduledWithoutArguments.counters[:before_schedule], 'before_schedule was not run')
assert_equal(1, JobThatCannotBeScheduledWithoutArguments.counters[:after_schedule], 'after_schedule was not run')
end
@@ -46,8 +46,8 @@ def test_schedule_job_that_can_reject_being_scheduled_and_does
enqueue_time = Time.now + 60
assert_equal(0, JobThatCannotBeScheduledWithoutArguments.counters[:before_schedule], 'before_schedule should be zero')
Resque.enqueue_at(enqueue_time, JobThatCannotBeScheduledWithoutArguments.clean)
- assert_equal(0, Resque.redis.llen("delayed:#{enqueue_time.to_i}").to_i, "job should not have been put in queue")
- assert_equal(0, Resque.redis.zcard(:delayed_queue_schedule), "schedule should be empty")
+ assert_equal(0, Resque.delayed_timestamp_size(enqueue_time.to_i), "job should not have been put in queue")
+ assert_equal(0, Resque.delayed_queue_schedule_size, "schedule should be empty")
assert_equal(1, JobThatCannotBeScheduledWithoutArguments.counters[:before_schedule], 'before_schedule was not run')
assert_equal(0, JobThatCannotBeScheduledWithoutArguments.counters[:after_schedule], 'after_schedule was run')
end
Please sign in to comment.
Something went wrong with that request. Please try again.