4 class TestRepeaterMonth < Test::Unit::TestCase
7 # Wed Aug 16 14:00:00 2006
8 @now = Time.local(2006, 8, 16, 14, 0, 0, 0)
14 time = Chronic::RepeaterMonth.new(:month).offset_by(@now, 1, :future)
15 assert_equal Time.local(2006, 9, 16, 14), time
17 time = Chronic::RepeaterMonth.new(:month).offset_by(@now, 5, :future)
18 assert_equal Time.local(2007, 1, 16, 14), time
22 time = Chronic::RepeaterMonth.new(:month).offset_by(@now, 1, :past)
23 assert_equal Time.local(2006, 7, 16, 14), time
25 time = Chronic::RepeaterMonth.new(:month).offset_by(@now, 10, :past)
26 assert_equal Time.local(2005, 10, 16, 14), time
32 span = Chronic::Span.new(@now, @now + 60)
33 offset_span = Chronic::RepeaterMonth.new(:month).offset(span, 1, :future)
35 assert_equal Time.local(2006, 9, 16, 14), offset_span.begin
36 assert_equal Time.local(2006, 9, 16, 14, 1), offset_span.end
40 span = Chronic::Span.new(@now, @now + 60)
41 offset_span = Chronic::RepeaterMonth.new(:month).offset(span, 1, :past)
43 assert_equal Time.local(2006, 7, 16, 14), offset_span.begin
44 assert_equal Time.local(2006, 7, 16, 14, 1), offset_span.end