Skip to content

Commit

Permalink
Fix Date specs
Browse files Browse the repository at this point in the history
We're still in the last commercial week of 2009, so fix the date
specs so they don't break on this case
  • Loading branch information
dbussink committed Jan 2, 2010
1 parent ca60feb commit ae58501
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/ruby/library/date/strptime_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@

it "should be able to show the week number with the week starting on sunday and monday" do
d = Date.today
Date.strptime("14", "%U").should == Date.commercial(d.cwyear, 14, 7)
Date.strptime("14", "%W").should == Date.commercial(d.cwyear, 15, 7)
Date.strptime("14", "%U").should == Date.commercial(d.cwyear, d.cweek, 7) + 7 * 13
Date.strptime("14", "%W").should == Date.commercial(d.cwyear, d.cweek, 7) + 7 * 14
end

it "should be able to show the commercial week day" do
Date.strptime("2008 1", "%G %u").should == Date.civil(2007, 12, 31)
end

it "should be able to show the commercial week" do
d = Date.commercial(Date.today.year,1,1)
d = Date.commercial(Date.today.cwyear,1,1)
Date.strptime("1", "%V").should == d
Date.strptime("15", "%V").should == Date.commercial(d.cwyear, 15, 1)
end
Expand Down

0 comments on commit ae58501

Please sign in to comment.