spec/date_spec.rb in partial-date-1.1.3 vs spec/date_spec.rb in partial-date-1.1.4

- old
+ new

@@ -100,19 +100,19 @@ no_year = PartialDate::Date.new expect {no_year.month = 10}.to raise_error(PartialDate::PartialDateError, "A year must be set before a month") end it "should raise an error if month is set to an invalid string" do - expect {date.month = "AB"}.to raise_error(PartialDate::PartialDateError, "Month must be a valid one or two digit string or integer between 1 and 12") + expect {date.month = "AB"}.to raise_error(PartialDate::PartialDateError, "Month must be a valid one or two digit string or integer between 0 and 12") end it "should raise an error if month is set to a value greater than 12" do - expect {date.month = 13}.to raise_error(PartialDate::PartialDateError, "Month must an be integer between 1 and 12") + expect {date.month = 13}.to raise_error(PartialDate::PartialDateError, "Month must an be integer between 0 and 12") end it "should raise an error if month is set to a value less than zero" do - expect {date.month = -1}.to raise_error(PartialDate::PartialDateError, "Month must an be integer between 1 and 12") + expect {date.month = -1}.to raise_error(PartialDate::PartialDateError, "Month must an be integer between 0 and 12") end it "should allow the month to be set to zero" do date.month = 0 date.month.should == 0 @@ -132,22 +132,22 @@ describe "Day" do before(:each) { date.year = 2000; date.month = 6 } it "should raise an error if a day is set before a year and month" do no_month = PartialDate::Date.new - expect {no_month.day = 10}.to raise_error(PartialDate::PartialDateError, "A year and month must be set before a day") + expect {no_month.day = 10}.to raise_error(PartialDate::PartialDateError, "A month must be set before a day") end it "should raise an error if day is set to an invalid string" do - expect {date.day = "AB"}.to raise_error(PartialDate::PartialDateError, "Day must be a valid one or two digit string or integer between 1 and 31") + expect {date.day = "AB"}.to raise_error(PartialDate::PartialDateError, "Day must be a valid one or two digit string or integer between 0 and 31") end it "should raise an error if day is set to a value less than zero" do - expect {date.day = -1}.to raise_error(PartialDate::PartialDateError, "Day must be an integer between 1 and 31") + expect {date.day = -1}.to raise_error(PartialDate::PartialDateError, "Day must be an integer between 0 and 31") end it "should raise an error if day is set to a value greater than 31" do - expect {date.day = 32}.to raise_error(PartialDate::PartialDateError, "Day must be an integer between 1 and 31") + expect {date.day = 32}.to raise_error(PartialDate::PartialDateError, "Day must be an integer between 0 and 31") end it "should raise an error if the day is an invalid day for the given month" do expect {date.day = 31}.to raise_error(PartialDate::PartialDateError, "Day must be a valid day for the given month") end