1
0
Fork 0
mirror of https://github.com/endofunky/sidetiq.git synced 2022-11-09 13:53:30 -05:00

Add tests for Sidetiq::Schedule.

This commit is contained in:
Tobias Svensson 2013-02-01 12:11:36 +00:00
parent e81850b5cb
commit 2d73e6f77f

25
test/test_schedule.rb Normal file
View file

@ -0,0 +1,25 @@
require_relative 'helper'
class TestSchedule < MiniTest::Unit::TestCase
def test_super
assert_equal IceCube::Schedule, Sidetiq::Schedule.superclass
end
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
end