test/test_deadline.rb in sculd-0.1.0 vs test/test_deadline.rb in sculd-0.1.1

- old
+ new

@@ -8,10 +8,13 @@ date = Date.new(2012, 10, 15) @d00 = Sculd::Plan::Deadline.new(date, false, 10, 'deadlineA') date = DateTime.new(2012, 10, 15, 23, 45, 00) @d01 = Sculd::Plan::Deadline.new(date, false, 10, 'deadlineA') + + date = Date.new(2012, 10, 15) + @d02 = Sculd::Plan::Deadline.new(date, false, nil, 'deadlineA') end #context 'Date[2012-10-15], 10, [2012-10-15]!10 deadlineA' do def test_priority @@ -24,9 +27,25 @@ today = Date.new(2012, 10, 10) assert_equal(15000, @d00.priority(today)) today = Date.new(2012, 10, 1) assert_equal(0, @d00.priority(today)) + + + today = Date.new(2012, 10, 1) + assert_equal( 0, @d02.priority(today)) + + today = Date.new(2012, 10, 8) + assert_equal(10000, @d02.priority(today)) + + today = Date.new(2012, 10, 10) + assert_equal(12857, @d02.priority(today)) + + today = Date.new(2012, 10, 15) + assert_equal(20000, @d02.priority(today)) + + today = Date.new(2012, 10, 20) + assert_equal(20000, @d02.priority(today)) end def test_event_dates results = @d00.event_dates assert_equal(2 , results.size)