Sha256: 6a810598d2df48fae58c14b525f2192e3b86c3a09a702dc2dbef5fc9a00b6b0e

Contents?: true

Size: 769 Bytes

Versions: 10

Compression:

Stored size: 769 Bytes

Contents

require_relative 'helper'

class TestWorker < Sidetiq::TestCase
  class FakeWorker
    include Sidetiq::Schedulable
  end

  def test_timestamps_for_new_worker
    assert FakeWorker.last_scheduled_occurrence == -1
    assert FakeWorker.next_scheduled_occurrence == -1
  end

  def test_timestamps_for_existing_worker
    last_run = (Time.now - 100).to_f
    next_run = (Time.now + 100).to_f

    Sidekiq.redis do |redis|
      redis.set "sidetiq:TestWorker::FakeWorker:last", last_run
      redis.set "sidetiq:TestWorker::FakeWorker:next", next_run
    end

    assert FakeWorker.last_scheduled_occurrence == last_run
    assert FakeWorker.next_scheduled_occurrence == next_run
  end

  def test_options
    assert Sidetiq.schedules[BackfillWorker].backfill?
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
sidetiq-0.4.0.rc2 test/test_worker.rb
sidetiq-0.4.0.rc1 test/test_worker.rb
sidetiq-0.3.7 test/test_worker.rb
sidetiq-0.3.6 test/test_worker.rb
sidetiq-0.3.5 test/test_worker.rb
sidetiq-0.3.4 test/test_worker.rb
sidetiq-0.3.3 test/test_worker.rb
sidetiq-0.3.2 test/test_worker.rb
sidetiq-0.3.1 test/test_worker.rb
sidetiq-0.3.0 test/test_worker.rb