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:
parent
e81850b5cb
commit
2d73e6f77f
1 changed files with 25 additions and 0 deletions
25
test/test_schedule.rb
Normal file
25
test/test_schedule.rb
Normal 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
|
||||
|
Loading…
Reference in a new issue