Module: ResqueUnitWithoutMock::SchedulerAssertions
- Defined in:
- lib/resque_unit_without_mock/scheduler_assertions.rb
Instance Method Summary collapse
- #assert_not_queued_at(expected_timestamp, klass) ⇒ Object
- #assert_not_queued_at_with_queue(queue, expected_timestamp, klass) ⇒ Object
- #assert_queued_at(expected_timestamp, klass) ⇒ Object
- #assert_queued_at_with_queue(queue, expected_timestamp, klass) ⇒ Object
Instance Method Details
#assert_not_queued_at(expected_timestamp, klass) ⇒ Object
6 7 8 |
# File 'lib/resque_unit_without_mock/scheduler_assertions.rb', line 6 def assert_not_queued_at(, klass) assert_not_queued_at_with_queue(Resque.queue_for(klass), , klass) end |
#assert_not_queued_at_with_queue(queue, expected_timestamp, klass) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/resque_unit_without_mock/scheduler_assertions.rb', line 18 def assert_not_queued_at_with_queue(queue, , klass) result = Resque.enqueue_ats(queue).detect { |hash| hash[:timestamp] <= && hash[:klass] == klass } assert( !result, "#{klass} should not have been queued in #{Resque.enqueue_ats(queue)} before #{}" ) end |
#assert_queued_at(expected_timestamp, klass) ⇒ Object
2 3 4 |
# File 'lib/resque_unit_without_mock/scheduler_assertions.rb', line 2 def assert_queued_at(, klass) assert_queued_at_with_queue(Resque.queue_for(klass), , klass) end |
#assert_queued_at_with_queue(queue, expected_timestamp, klass) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/resque_unit_without_mock/scheduler_assertions.rb', line 10 def assert_queued_at_with_queue(queue, , klass) result = Resque.enqueue_ats(queue).detect { |hash| hash[:timestamp] <= && hash[:klass] == klass } assert( result, "#{klass} should have been queued in #{Resque.enqueue_ats(queue)} before #{}" ) end |