2 require File.dirname(__FILE__) + '/../../spec_helper'
4 describe "Date#gregorian?" do
6 it "should mark a day before the calendar reform as Julian" do
7 Date.civil(1007, 2, 27).gregorian?.should == false
8 Date.civil(1907, 2, 27, Date.civil(2000, 1, 1).jd).gregorian?.should == false
11 it "should mark a day after the calendar reform as Julian" do
12 Date.civil(2007, 2, 27).gregorian?.should == true
13 Date.civil(1007, 2, 27, Date.civil(1000, 1, 1).jd).gregorian?.should == true
18 describe "Date#gregorian_leap?" do
20 it "should be able to determine whether a year is a leap year in the Gregorian calendar" do
21 Date.gregorian_leap?(1900).should == false
22 Date.gregorian_leap?(1999).should == false
23 Date.gregorian_leap?(2000).should == true
24 Date.gregorian_leap?(2002).should == false
25 Date.gregorian_leap?(2004).should == true