Browse files

Added spec to show that Sunday rewinds

* Ruby's Date considers Sunday to the the start of the week so it's
  natural to assume (incorrectly) that Sunday would advance to the
  next Monday. The planner considers Monday to be the start of the
  week, however, so if you want the planner showing, say 2012-03-11,
  you'll want the planner starting on 2012-03-05
  • Loading branch information...
1 parent f98300c commit 2328cfed1b8e699b4331703f77937bb2bdde1c6a @dbrady committed Mar 14, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 spec/lib/planner_spec.rb
4 spec/lib/planner_spec.rb
@@ -19,6 +19,10 @@ def md5(string)
it "does not rewind if given date is a Monday" do
Planner.rewind_to_monday(Date.parse('2012-03-12')).should == Date.parse('2012-03-12')
+ it "rewinds if given date is a Sunday" do
+ Planner.rewind_to_monday(Date.parse('2012-03-11')).should == Date.parse('2012-03-05')
+ end
describe ".draw" do

0 comments on commit 2328cfe

Please sign in to comment.