Sha256: afbb1254d53853dc3cfcdf3c144d24f511c31bd2d7af2e2645d97949038e29bc

Contents?: true

Size: 857 Bytes

Versions: 17

Compression:

Stored size: 857 Bytes

Contents

require_relative 'helper'

class TestSchedule < Sidetiq::TestCase
  def test_method_missing
    sched = Sidetiq::Schedule.new
    sched.daily
    assert_equal "Daily", sched.to_s
  end

  def test_schedule_next?
    sched = Sidetiq::Schedule.new

    sched.daily

    assert sched.schedule_next?(Time.now + (24 * 60 * 60))
    refute sched.schedule_next?(Time.now + (24 * 60 * 60))
    assert sched.schedule_next?(Time.now + (2 * 24 * 60 * 60))
    refute sched.schedule_next?(Time.now + (2 * 24 * 60 * 60))
  end

  def test_backfill
    sched = Sidetiq::Schedule.new
    refute sched.backfill?
    sched.backfill = true
    assert sched.backfill?
  end

  def test_set_options
    sched = Sidetiq::Schedule.new

    sched.set_options(backfill: true)
    assert sched.backfill?

    sched.set_options(backfill: false)
    refute sched.backfill?
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
sidetiq-0.5.0 test/test_schedule.rb
sidetiq-0.4.3 test/test_schedule.rb
sidetiq-0.4.2 test/test_schedule.rb
sidetiq-0.4.1 test/test_schedule.rb
sidetiq-0.4.0 test/test_schedule.rb
sidetiq-0.4.0.rc4 test/test_schedule.rb
sidetiq-0.4.0.rc3 test/test_schedule.rb
sidetiq-0.4.0.rc2 test/test_schedule.rb
sidetiq-0.4.0.rc1 test/test_schedule.rb
sidetiq-0.3.7 test/test_schedule.rb
sidetiq-0.3.6 test/test_schedule.rb
sidetiq-0.3.5 test/test_schedule.rb
sidetiq-0.3.4 test/test_schedule.rb
sidetiq-0.3.3 test/test_schedule.rb
sidetiq-0.3.2 test/test_schedule.rb
sidetiq-0.3.1 test/test_schedule.rb
sidetiq-0.3.0 test/test_schedule.rb