diff options
Diffstat (limited to 'spec/rubyspec/library/date')
109 files changed, 0 insertions, 1836 deletions
diff --git a/spec/rubyspec/library/date/accessor_spec.rb b/spec/rubyspec/library/date/accessor_spec.rb deleted file mode 100644 index 91e0c3fc88..0000000000 --- a/spec/rubyspec/library/date/accessor_spec.rb +++ /dev/null @@ -1,91 +0,0 @@ -require 'date' -require File.expand_path('../../../spec_helper', __FILE__) - -describe "Date#ajd" do - it "determines the Astronomical Julian day" do - Date.civil(2007, 1, 17).ajd.should == 4908235.to_r / 2 - end -end - -describe "Date#amjd" do - it "determines the Astronomical Modified Julian day" do - Date.civil(2007, 1, 17).amjd.should == 54117 - end -end - -describe "Date#day_fraction" do - it "determines the day fraction" do - Date.civil(2007, 1, 17).day_fraction.should == 0 - end -end - -describe "Date#mjd" do - it "determines the Modified Julian day" do - Date.civil(2007, 1, 17).mjd.should == 54117 - end -end - -describe "Date#ld" do - it "determines the Modified Julian day" do - Date.civil(2007, 1, 17).ld.should == 154958 - end -end - -describe "Date#year" do - it "determines the year" do - Date.civil(2007, 1, 17).year.should == 2007 - end -end - -describe "Date#yday" do - it "determines the year" do - Date.civil(2007, 1, 17).yday.should == 17 - Date.civil(2008, 10, 28).yday.should == 302 - end -end - -describe "Date#mon" do - it "determines the month" do - Date.civil(2007, 1, 17).mon.should == 1 - Date.civil(2008, 10, 28).mon.should == 10 - end -end - -describe "Date#mday" do - it "determines the day of the month" do - Date.civil(2007, 1, 17).mday.should == 17 - Date.civil(2008, 10, 28).mday.should == 28 - end -end - -describe "Date#wday" do - it "determines the week day" do - Date.civil(2007, 1, 17).wday.should == 3 - Date.civil(2008, 10, 26).wday.should == 0 - end -end - -describe "Date#cwyear" do - it "determines the commercial year" do - Date.civil(2007, 1, 17).cwyear.should == 2007 - Date.civil(2008, 10, 28).cwyear.should == 2008 - Date.civil(2007, 12, 31).cwyear.should == 2008 - Date.civil(2010, 1, 1).cwyear.should == 2009 - end -end - -describe "Date#cweek" do - it "determines the commercial week" do - Date.civil(2007, 1, 17).cweek.should == 3 - Date.civil(2008, 10, 28).cweek.should == 44 - Date.civil(2007, 12, 31).cweek.should == 1 - Date.civil(2010, 1, 1).cweek.should == 53 - end -end - -describe "Date#cwday" do - it "determines the commercial week day" do - Date.civil(2007, 1, 17).cwday.should == 3 - Date.civil(2008, 10, 26).cwday.should == 7 - end -end diff --git a/spec/rubyspec/library/date/add_month_spec.rb b/spec/rubyspec/library/date/add_month_spec.rb deleted file mode 100644 index 46f1915b70..0000000000 --- a/spec/rubyspec/library/date/add_month_spec.rb +++ /dev/null @@ -1,38 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#>>" do - it "adds the number of months to a Date" do - d = Date.civil(2007,2,27) >> 10 - d.should == Date.civil(2007, 12, 27) - end - - it "sets the day to the last day of a month if the day doesn't exist" do - d = Date.civil(2008,3,31) >> 1 - d.should == Date.civil(2008, 4, 30) - end - - it "returns the day of the reform if date falls within calendar reform" do - calendar_reform_italy = Date.new(1582, 10, 4) - d1 = Date.new(1582, 9, 9) >> 1 - d2 = Date.new(1582, 9, 10) >> 1 - d1.should == calendar_reform_italy - d2.should == calendar_reform_italy - end - - it "raise a TypeError when passed a Symbol" do - lambda { Date.civil(2007,2,27) >> :hello }.should raise_error(TypeError) - end - - it "raise a TypeError when passed a String" do - lambda { Date.civil(2007,2,27) >> "hello" }.should raise_error(TypeError) - end - - it "raise a TypeError when passed a Date" do - lambda { Date.civil(2007,2,27) >> Date.new }.should raise_error(TypeError) - end - - it "raise a TypeError when passed an Object" do - lambda { Date.civil(2007,2,27) >> Object.new }.should raise_error(TypeError) - end -end diff --git a/spec/rubyspec/library/date/add_spec.rb b/spec/rubyspec/library/date/add_spec.rb deleted file mode 100644 index 022b793318..0000000000 --- a/spec/rubyspec/library/date/add_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#+" do - it "adds the number of days to a Date" do - d = Date.civil(2007,2,27) + 10 - d.should == Date.civil(2007, 3, 9) - end - - it "adds a negative number of days to a Date" do - d = Date.civil(2007,2,27).+(-10) - d.should == Date.civil(2007, 2, 17) - end - - it "raises a TypeError when passed a Symbol" do - lambda { Date.civil(2007,2,27) + :hello }.should raise_error(TypeError) - end - - it "raises a TypeError when passed a String" do - lambda { Date.civil(2007,2,27) + "hello" }.should raise_error(TypeError) - end - - it "raises a TypeError when passed a Date" do - lambda { Date.civil(2007,2,27) + Date.new }.should raise_error(TypeError) - end - - it "raises a TypeError when passed an Object" do - lambda { Date.civil(2007,2,27) + Object.new }.should raise_error(TypeError) - end -end diff --git a/spec/rubyspec/library/date/ajd_spec.rb b/spec/rubyspec/library/date/ajd_spec.rb deleted file mode 100644 index fcbcea2426..0000000000 --- a/spec/rubyspec/library/date/ajd_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#ajd" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/ajd_to_amjd_spec.rb b/spec/rubyspec/library/date/ajd_to_amjd_spec.rb deleted file mode 100644 index fc6a35d0c6..0000000000 --- a/spec/rubyspec/library/date/ajd_to_amjd_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date.ajd_to_amjd" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/ajd_to_jd_spec.rb b/spec/rubyspec/library/date/ajd_to_jd_spec.rb deleted file mode 100644 index 1d8d6d0eb5..0000000000 --- a/spec/rubyspec/library/date/ajd_to_jd_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date.ajd_to_jd" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/amjd_spec.rb b/spec/rubyspec/library/date/amjd_spec.rb deleted file mode 100644 index 212871ee18..0000000000 --- a/spec/rubyspec/library/date/amjd_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#amjd" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/amjd_to_ajd_spec.rb b/spec/rubyspec/library/date/amjd_to_ajd_spec.rb deleted file mode 100644 index f45f202a40..0000000000 --- a/spec/rubyspec/library/date/amjd_to_ajd_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date.amjd_to_ajd" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/append_spec.rb b/spec/rubyspec/library/date/append_spec.rb deleted file mode 100644 index d90eff9a7a..0000000000 --- a/spec/rubyspec/library/date/append_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#<<" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/asctime_spec.rb b/spec/rubyspec/library/date/asctime_spec.rb deleted file mode 100644 index 13dede0f05..0000000000 --- a/spec/rubyspec/library/date/asctime_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#asctime" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/boat_spec.rb b/spec/rubyspec/library/date/boat_spec.rb deleted file mode 100644 index 3004c6bfbc..0000000000 --- a/spec/rubyspec/library/date/boat_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#<=>" do - it "returns 0 when two dates are equal" do - (Date.civil(2000, 04, 06) <=> Date.civil(2000, 04, 06)).should == 0 - end - - it "returns -1 when self is less than another date" do - (Date.civil(2000, 04, 05) <=> Date.civil(2000, 04, 06)).should == -1 - end - - it "returns -1 when self is less than a Numeric" do - (Date.civil(2000, 04, 05) <=> Date.civil(2000, 04, 06).jd).should == -1 - end - - it "returns 1 when self is greater than another date" do - (Date.civil(2001, 04, 05) <=> Date.civil(2000, 04, 06)).should == 1 - end - - it "returns 1 when self is greater than a Numeric" do - (Date.civil(2001, 04, 05) <=> Date.civil(2000, 04, 06).jd).should == 1 - end -end diff --git a/spec/rubyspec/library/date/case_compare_spec.rb b/spec/rubyspec/library/date/case_compare_spec.rb deleted file mode 100644 index 2144a616a3..0000000000 --- a/spec/rubyspec/library/date/case_compare_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#===" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/civil_spec.rb b/spec/rubyspec/library/date/civil_spec.rb deleted file mode 100644 index 36e790aecd..0000000000 --- a/spec/rubyspec/library/date/civil_spec.rb +++ /dev/null @@ -1,12 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require File.expand_path('../shared/civil', __FILE__) -require 'date' - -describe "Date#civil" do - it_behaves_like(:date_civil, :civil) -end - - -describe "Date.civil" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/commercial_spec.rb b/spec/rubyspec/library/date/commercial_spec.rb deleted file mode 100644 index bb6671eda1..0000000000 --- a/spec/rubyspec/library/date/commercial_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -require 'date' -require File.expand_path('../../../spec_helper', __FILE__) -require File.expand_path('../shared/commercial', __FILE__) - -describe "Date#commercial" do - - it_behaves_like(:date_commercial, :commercial) - -end - -# reference: -# October 1582 (the Gregorian calendar, Civil Date) -# S M Tu W Th F S -# 1 2 3 4 15 16 -# 17 18 19 20 21 22 23 -# 24 25 26 27 28 29 30 -# 31 - diff --git a/spec/rubyspec/library/date/commercial_to_jd_spec.rb b/spec/rubyspec/library/date/commercial_to_jd_spec.rb deleted file mode 100644 index 61631a7977..0000000000 --- a/spec/rubyspec/library/date/commercial_to_jd_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date.commercial_to_jd" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/comparison_spec.rb b/spec/rubyspec/library/date/comparison_spec.rb deleted file mode 100644 index 04bfa2e8f7..0000000000 --- a/spec/rubyspec/library/date/comparison_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#<=>" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/constants_spec.rb b/spec/rubyspec/library/date/constants_spec.rb deleted file mode 100644 index 8e564fe665..0000000000 --- a/spec/rubyspec/library/date/constants_spec.rb +++ /dev/null @@ -1,44 +0,0 @@ -require 'date' -require File.expand_path('../../../spec_helper', __FILE__) - -describe "Date constants" do - - it "defines JULIAN" do - (Date::JULIAN <=> Date::Infinity.new).should == 0 - end - - it "defines GREGORIAN" do - (Date::GREGORIAN <=> -Date::Infinity.new).should == 0 - end - - it "defines ITALY" do - Date::ITALY.should == 2299161 # 1582-10-15 - end - - it "defines ENGLAND" do - Date::ENGLAND.should == 2361222 # 1752-09-14 - end - - it "defines MONTHNAMES" do - Date::MONTHNAMES.should == [nil] + %w(January February March April May June July - August September October November December) - end - - it "defines DAYNAMES" do - Date::DAYNAMES.should == %w(Sunday Monday Tuesday Wednesday Thursday Friday Saturday) - end - - it "defines ABBR_MONTHNAMES" do - Date::ABBR_DAYNAMES.should == %w(Sun Mon Tue Wed Thu Fri Sat) - end - - it "freezes MONTHNAMES, DAYNAMES, ABBR_MONTHNAMES, ABBR_DAYSNAMES" do - [Date::MONTHNAMES, Date::DAYNAMES, Date::ABBR_MONTHNAMES, Date::ABBR_DAYNAMES].each do |ary| - lambda { ary << "Unknown" }.should raise_error - ary.compact.each do |name| - lambda { name << "modified" }.should raise_error - end - end - end - -end diff --git a/spec/rubyspec/library/date/conversions_spec.rb b/spec/rubyspec/library/date/conversions_spec.rb deleted file mode 100644 index c52ade7012..0000000000 --- a/spec/rubyspec/library/date/conversions_spec.rb +++ /dev/null @@ -1,43 +0,0 @@ -require 'date' -require File.expand_path('../../../spec_helper', __FILE__) - - -describe "Date#new_start" do - it "converts a date object into another with a new calendar reform" do - Date.civil(1582, 10, 14, Date::ENGLAND).new_start.should == Date.civil(1582, 10, 24) - Date.civil(1582, 10, 4, Date::ENGLAND).new_start.should == Date.civil(1582, 10, 4) - Date.civil(1582, 10, 15).new_start(Date::ENGLAND).should == Date.civil(1582, 10, 5, Date::ENGLAND) - Date.civil(1752, 9, 14).new_start(Date::ENGLAND).should == Date.civil(1752, 9, 14, Date::ENGLAND) - Date.civil(1752, 9, 13).new_start(Date::ENGLAND).should == Date.civil(1752, 9, 2, Date::ENGLAND) - end -end - -describe "Date#italy" do - it "converts a date object into another with the Italian calendar reform" do - Date.civil(1582, 10, 14, Date::ENGLAND).italy.should == Date.civil(1582, 10, 24) - Date.civil(1582, 10, 4, Date::ENGLAND).italy.should == Date.civil(1582, 10, 4) - end -end - -describe "Date#england" do - it "converts a date object into another with the English calendar reform" do - Date.civil(1582, 10, 15).england.should == Date.civil(1582, 10, 5, Date::ENGLAND) - Date.civil(1752, 9, 14).england.should == Date.civil(1752, 9, 14, Date::ENGLAND) - Date.civil(1752, 9, 13).england.should == Date.civil(1752, 9, 2, Date::ENGLAND) - end -end - -describe "Date#julian" do - it "converts a date object into another with the Julian calendar" do - Date.civil(1582, 10, 15).julian.should == Date.civil(1582, 10, 5, Date::JULIAN) - Date.civil(1752, 9, 14).julian.should == Date.civil(1752, 9, 3, Date::JULIAN) - Date.civil(1752, 9, 13).julian.should == Date.civil(1752, 9, 2, Date::JULIAN) - end -end - -describe "Date#gregorian" do - it "converts a date object into another with the Gregorian calendar" do - Date.civil(1582, 10, 4).gregorian.should == Date.civil(1582, 10, 14, Date::GREGORIAN) - Date.civil(1752, 9, 14).gregorian.should == Date.civil(1752, 9, 14, Date::GREGORIAN) - end -end diff --git a/spec/rubyspec/library/date/ctime_spec.rb b/spec/rubyspec/library/date/ctime_spec.rb deleted file mode 100644 index 0f5d594842..0000000000 --- a/spec/rubyspec/library/date/ctime_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#ctime" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/cwday_spec.rb b/spec/rubyspec/library/date/cwday_spec.rb deleted file mode 100644 index 33ede37b2c..0000000000 --- a/spec/rubyspec/library/date/cwday_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#cwday" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/cweek_spec.rb b/spec/rubyspec/library/date/cweek_spec.rb deleted file mode 100644 index d988bdd9db..0000000000 --- a/spec/rubyspec/library/date/cweek_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#cweek" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/cwyear_spec.rb b/spec/rubyspec/library/date/cwyear_spec.rb deleted file mode 100644 index 00544927bc..0000000000 --- a/spec/rubyspec/library/date/cwyear_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#cwyear" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/day_fraction_spec.rb b/spec/rubyspec/library/date/day_fraction_spec.rb deleted file mode 100644 index 64896a421e..0000000000 --- a/spec/rubyspec/library/date/day_fraction_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#day_fraction" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/day_fraction_to_time_spec.rb b/spec/rubyspec/library/date/day_fraction_to_time_spec.rb deleted file mode 100644 index 609367371a..0000000000 --- a/spec/rubyspec/library/date/day_fraction_to_time_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date.day_fraction_to_time" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/day_spec.rb b/spec/rubyspec/library/date/day_spec.rb deleted file mode 100644 index 7dfca4d77c..0000000000 --- a/spec/rubyspec/library/date/day_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#day" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/downto_spec.rb b/spec/rubyspec/library/date/downto_spec.rb deleted file mode 100644 index ab9bf11952..0000000000 --- a/spec/rubyspec/library/date/downto_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -require 'date' -require File.expand_path('../../../spec_helper', __FILE__) - -describe "Date#downto" do - - it "creates earlier dates when passed a negative step" do - ds = Date.civil(2000, 4, 14) - de = Date.civil(2000, 3, 29) - count = 0 - ds.step(de, -1) do |d| - d.should <= ds - d.should >= de - count += 1 - end - count.should == 17 - end - -end diff --git a/spec/rubyspec/library/date/england_spec.rb b/spec/rubyspec/library/date/england_spec.rb deleted file mode 100644 index 6c67c6ee86..0000000000 --- a/spec/rubyspec/library/date/england_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#england" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/eql_spec.rb b/spec/rubyspec/library/date/eql_spec.rb deleted file mode 100644 index efecde8944..0000000000 --- a/spec/rubyspec/library/date/eql_spec.rb +++ /dev/null @@ -1,12 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#eql?" do - it "returns true if self is equal to another date" do - Date.civil(2007, 10, 11).eql?(Date.civil(2007, 10, 11)).should be_true - end - - it "returns false if self is not equal to another date" do - Date.civil(2007, 10, 11).eql?(Date.civil(2007, 10, 12)).should be_false - end -end diff --git a/spec/rubyspec/library/date/format/bag/method_missing_spec.rb b/spec/rubyspec/library/date/format/bag/method_missing_spec.rb deleted file mode 100644 index 529fde05d2..0000000000 --- a/spec/rubyspec/library/date/format/bag/method_missing_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../../../spec_helper', __FILE__) -require 'date' - -describe "Date::Format::Bag#method_missing" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/format/bag/to_hash_spec.rb b/spec/rubyspec/library/date/format/bag/to_hash_spec.rb deleted file mode 100644 index ba9525e5e8..0000000000 --- a/spec/rubyspec/library/date/format/bag/to_hash_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../../../spec_helper', __FILE__) -require 'date' - -describe "Date::Format::Bag#to_hash" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/gregorian_leap_spec.rb b/spec/rubyspec/library/date/gregorian_leap_spec.rb deleted file mode 100644 index 043d57aa93..0000000000 --- a/spec/rubyspec/library/date/gregorian_leap_spec.rb +++ /dev/null @@ -1,16 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#gregorian_leap?" do - it "returns true if a year is a leap year in the Gregorian calendar" do - Date.gregorian_leap?(2000).should be_true - Date.gregorian_leap?(2004).should be_true - end - - it "returns false if a year is not a leap year in the Gregorian calendar" do - Date.gregorian_leap?(1900).should be_false - Date.gregorian_leap?(1999).should be_false - Date.gregorian_leap?(2002).should be_false - end -end - diff --git a/spec/rubyspec/library/date/gregorian_spec.rb b/spec/rubyspec/library/date/gregorian_spec.rb deleted file mode 100644 index 5d8b38b2d8..0000000000 --- a/spec/rubyspec/library/date/gregorian_spec.rb +++ /dev/null @@ -1,16 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#gregorian?" do - - it "marks a day before the calendar reform as Julian" do - Date.civil(1007, 2, 27).gregorian?.should be_false - Date.civil(1907, 2, 27, Date.civil(1930, 1, 1).jd).gregorian?.should be_false - end - - it "marks a day after the calendar reform as Julian" do - Date.civil(2007, 2, 27).gregorian?.should == true - Date.civil(1607, 2, 27, Date.civil(1582, 1, 1).jd).gregorian?.should be_true - end - -end diff --git a/spec/rubyspec/library/date/hash_spec.rb b/spec/rubyspec/library/date/hash_spec.rb deleted file mode 100644 index 271d565253..0000000000 --- a/spec/rubyspec/library/date/hash_spec.rb +++ /dev/null @@ -1,8 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#hash" do - it "returns the same value for equal dates" do - Date.civil(2004, 7, 12).hash.should == Date.civil(2004, 7, 12).hash - end -end diff --git a/spec/rubyspec/library/date/infinity/abs_spec.rb b/spec/rubyspec/library/date/infinity/abs_spec.rb deleted file mode 100644 index a1107679f6..0000000000 --- a/spec/rubyspec/library/date/infinity/abs_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require 'date' - -describe "Date::Infinity#abs" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/infinity/coerce_spec.rb b/spec/rubyspec/library/date/infinity/coerce_spec.rb deleted file mode 100644 index e09b948064..0000000000 --- a/spec/rubyspec/library/date/infinity/coerce_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require 'date' - -describe "Date::Infinity#coerce" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/infinity/comparison_spec.rb b/spec/rubyspec/library/date/infinity/comparison_spec.rb deleted file mode 100644 index 7bf8fb7b9f..0000000000 --- a/spec/rubyspec/library/date/infinity/comparison_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require 'date' - -describe "Date::Infinity#<=>" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/infinity/d_spec.rb b/spec/rubyspec/library/date/infinity/d_spec.rb deleted file mode 100644 index 9ef1f71408..0000000000 --- a/spec/rubyspec/library/date/infinity/d_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require 'date' - -describe "Date::Infinity#d" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/infinity/finite_spec.rb b/spec/rubyspec/library/date/infinity/finite_spec.rb deleted file mode 100644 index 92806935fc..0000000000 --- a/spec/rubyspec/library/date/infinity/finite_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require 'date' - -describe "Date::Infinity#finite?" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/infinity/infinite_spec.rb b/spec/rubyspec/library/date/infinity/infinite_spec.rb deleted file mode 100644 index 8c7e0bc86a..0000000000 --- a/spec/rubyspec/library/date/infinity/infinite_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require 'date' - -describe "Date::Infinity#infinite?" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/infinity/nan_spec.rb b/spec/rubyspec/library/date/infinity/nan_spec.rb deleted file mode 100644 index 19c7ae0af3..0000000000 --- a/spec/rubyspec/library/date/infinity/nan_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require 'date' - -describe "Date::Infinity#nan?" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/infinity/uminus_spec.rb b/spec/rubyspec/library/date/infinity/uminus_spec.rb deleted file mode 100644 index 110e197231..0000000000 --- a/spec/rubyspec/library/date/infinity/uminus_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require 'date' - -describe "Date::Infinity#-@" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/infinity/uplus_spec.rb b/spec/rubyspec/library/date/infinity/uplus_spec.rb deleted file mode 100644 index dfc60b6b61..0000000000 --- a/spec/rubyspec/library/date/infinity/uplus_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require 'date' - -describe "Date::Infinity#+@" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/infinity/zero_spec.rb b/spec/rubyspec/library/date/infinity/zero_spec.rb deleted file mode 100644 index 2f4347255b..0000000000 --- a/spec/rubyspec/library/date/infinity/zero_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../../spec_helper', __FILE__) -require 'date' - -describe "Date::Infinity#zero?" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/infinity_spec.rb b/spec/rubyspec/library/date/infinity_spec.rb deleted file mode 100644 index 127fb8c2f4..0000000000 --- a/spec/rubyspec/library/date/infinity_spec.rb +++ /dev/null @@ -1,67 +0,0 @@ -require 'date' -require File.expand_path('../../../spec_helper', __FILE__) - -describe "Date::Infinity" do - - it "should be able to check whether Infinity is zero" do - i = Date::Infinity.new - i.zero?.should == false - end - - it "should be able to check whether Infinity is finite" do - i1 = Date::Infinity.new - i1.finite?.should == false - i2 = Date::Infinity.new(-1) - i2.finite?.should == false - i3 = Date::Infinity.new(0) - i3.finite?.should == false - end - - it "should be able to check whether Infinity is infinite" do - i1 = Date::Infinity.new - i1.infinite?.should == 1 - i2 = Date::Infinity.new(-1) - i2.infinite?.should == -1 - i3 = Date::Infinity.new(0) - i3.infinite?.should == nil - end - - it "should be able to check whether Infinity is not a number" do - i1 = Date::Infinity.new - i1.nan?.should == false - i2 = Date::Infinity.new(-1) - i2.nan?.should == false - i3 = Date::Infinity.new(0) - i3.nan?.should == true - end - - it "should be able to compare Infinity objects" do - i1 = Date::Infinity.new - i2 = Date::Infinity.new(-1) - i3 = Date::Infinity.new(0) - i4 = Date::Infinity.new - (i4 <=> i1).should == 0 - (i3 <=> i1).should == -1 - (i2 <=> i1).should == -1 - (i3 <=> i2).should == 1 - end - - it "should be able to return plus Infinity for abs" do - i1 = Date::Infinity.new - i2 = Date::Infinity.new(-1) - i3 = Date::Infinity.new(0) - (i2.abs <=> i1).should == 0 - (i3.abs <=> i1).should == 0 - end - - it "should be able to use -@ and +@ for Date::Infinity" do - (Date::Infinity.new <=> +Date::Infinity.new).should == 0 - (Date::Infinity.new(-1) <=> -Date::Infinity.new).should == 0 - end - - it "should be able to coerce a Date::Infinity object" do - Date::Infinity.new.coerce(1).should == [-1, 1] - Date::Infinity.new(0).coerce(2).should == [0, 0] - Date::Infinity.new(-1).coerce(1.5).should == [1, -1] - end -end diff --git a/spec/rubyspec/library/date/inspect_spec.rb b/spec/rubyspec/library/date/inspect_spec.rb deleted file mode 100644 index 150eb6bf24..0000000000 --- a/spec/rubyspec/library/date/inspect_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#inspect" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/italy_spec.rb b/spec/rubyspec/library/date/italy_spec.rb deleted file mode 100644 index 2d251db1b0..0000000000 --- a/spec/rubyspec/library/date/italy_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#italy" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/jd_spec.rb b/spec/rubyspec/library/date/jd_spec.rb deleted file mode 100644 index ccf6b93e06..0000000000 --- a/spec/rubyspec/library/date/jd_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require File.expand_path('../shared/jd', __FILE__) -require 'date' - -describe "Date#jd" do - - it "determines the Julian day for a Date object" do - Date.civil(2008, 1, 16).jd.should == 2454482 - end - -end - -describe "Date.jd" do - it_behaves_like :date_jd, :jd -end diff --git a/spec/rubyspec/library/date/jd_to_ajd_spec.rb b/spec/rubyspec/library/date/jd_to_ajd_spec.rb deleted file mode 100644 index 38a12bd65d..0000000000 --- a/spec/rubyspec/library/date/jd_to_ajd_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date.jd_to_ajd" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/jd_to_civil_spec.rb b/spec/rubyspec/library/date/jd_to_civil_spec.rb deleted file mode 100644 index 8608de2698..0000000000 --- a/spec/rubyspec/library/date/jd_to_civil_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date.jd_to_civil" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/jd_to_commercial_spec.rb b/spec/rubyspec/library/date/jd_to_commercial_spec.rb deleted file mode 100644 index 97d76130f2..0000000000 --- a/spec/rubyspec/library/date/jd_to_commercial_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date.jd_to_commercial" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/jd_to_ld_spec.rb b/spec/rubyspec/library/date/jd_to_ld_spec.rb deleted file mode 100644 index d27ada6b6c..0000000000 --- a/spec/rubyspec/library/date/jd_to_ld_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date.jd_to_ld" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/jd_to_mjd_spec.rb b/spec/rubyspec/library/date/jd_to_mjd_spec.rb deleted file mode 100644 index 064134c7ed..0000000000 --- a/spec/rubyspec/library/date/jd_to_mjd_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date.jd_to_mjd" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/jd_to_ordinal_spec.rb b/spec/rubyspec/library/date/jd_to_ordinal_spec.rb deleted file mode 100644 index a5f5c79641..0000000000 --- a/spec/rubyspec/library/date/jd_to_ordinal_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date.jd_to_ordinal" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/jd_to_wday_spec.rb b/spec/rubyspec/library/date/jd_to_wday_spec.rb deleted file mode 100644 index 569a53e409..0000000000 --- a/spec/rubyspec/library/date/jd_to_wday_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date.jd_to_wday" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/julian_leap_spec.rb b/spec/rubyspec/library/date/julian_leap_spec.rb deleted file mode 100644 index 3915f97693..0000000000 --- a/spec/rubyspec/library/date/julian_leap_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date.julian_leap?" do - it "determines whether a year is a leap year in the Julian calendar" do - Date.julian_leap?(1900).should be_true - Date.julian_leap?(2000).should be_true - Date.julian_leap?(2004).should be_true - end - - it "determines whether a year is not a leap year in the Julian calendar" do - Date.julian_leap?(1999).should be_false - Date.julian_leap?(2002).should be_false - end -end diff --git a/spec/rubyspec/library/date/julian_spec.rb b/spec/rubyspec/library/date/julian_spec.rb deleted file mode 100644 index 8cbe27b881..0000000000 --- a/spec/rubyspec/library/date/julian_spec.rb +++ /dev/null @@ -1,16 +0,0 @@ -require 'date' -require File.expand_path('../../../spec_helper', __FILE__) - -describe "Date#julian?" do - - it "marks a day before the calendar reform as Julian" do - Date.civil(1007, 2, 27).julian?.should == true - Date.civil(1907, 2, 27, Date.civil(1930, 1, 1).jd).julian?.should be_true - end - - it "marks a day after the calendar reform as Julian" do - Date.civil(2007, 2, 27).julian?.should == false - Date.civil(1607, 2, 27, Date.civil(1582, 1, 1).jd).julian?.should be_false - end - -end diff --git a/spec/rubyspec/library/date/ld_spec.rb b/spec/rubyspec/library/date/ld_spec.rb deleted file mode 100644 index a59b519c04..0000000000 --- a/spec/rubyspec/library/date/ld_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#ld" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/ld_to_jd_spec.rb b/spec/rubyspec/library/date/ld_to_jd_spec.rb deleted file mode 100644 index 7adbbede37..0000000000 --- a/spec/rubyspec/library/date/ld_to_jd_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date.ld_to_jd" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/leap_spec.rb b/spec/rubyspec/library/date/leap_spec.rb deleted file mode 100644 index bb8e920a3e..0000000000 --- a/spec/rubyspec/library/date/leap_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#leap?" do - it "needs to be reviewed for spec completeness" -end - -describe "Date.leap?" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/mday_spec.rb b/spec/rubyspec/library/date/mday_spec.rb deleted file mode 100644 index 8a1d6e8d59..0000000000 --- a/spec/rubyspec/library/date/mday_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#mday" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/minus_month_spec.rb b/spec/rubyspec/library/date/minus_month_spec.rb deleted file mode 100644 index b6b20c5578..0000000000 --- a/spec/rubyspec/library/date/minus_month_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -require 'date' -require File.expand_path('../../../spec_helper', __FILE__) - -describe "Date#<<" do - - it "substracts a number of months from a date" do - d = Date.civil(2007,2,27) << 10 - d.should == Date.civil(2006, 4, 27) - end - - it "returns the last day of a month if the day doesn't exist" do - d = Date.civil(2008,3,31) << 1 - d.should == Date.civil(2008, 2, 29) - end - - ruby_version_is ""..."2.3" do - it "raises an error on non numeric parameters" do - lambda { Date.civil(2007,2,27) << :hello }.should raise_error - lambda { Date.civil(2007,2,27) << "hello" }.should raise_error - lambda { Date.civil(2007,2,27) << Date.new }.should raise_error - lambda { Date.civil(2007,2,27) << Object.new }.should raise_error - end - end - - ruby_version_is "2.3" do - it "raises an error on non numeric parameters" do - lambda { Date.civil(2007,2,27) << :hello }.should raise_error(TypeError) - lambda { Date.civil(2007,2,27) << "hello" }.should raise_error(TypeError) - lambda { Date.civil(2007,2,27) << Date.new }.should raise_error(TypeError) - lambda { Date.civil(2007,2,27) << Object.new }.should raise_error(TypeError) - end - end - -end diff --git a/spec/rubyspec/library/date/minus_spec.rb b/spec/rubyspec/library/date/minus_spec.rb deleted file mode 100644 index 09da595872..0000000000 --- a/spec/rubyspec/library/date/minus_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -require 'date' -require File.expand_path('../../../spec_helper', __FILE__) - -describe "Date#-" do - - it "substracts a number of days from a Date" do - d = Date.civil(2007, 5 ,2) - 13 - d.should == Date.civil(2007, 4, 19) - end - - it "substracts a negative number of days from a Date" do - d = Date.civil(2007, 4, 19).-(-13) - d.should == Date.civil(2007, 5 ,2) - end - - it "computes the difference between two dates" do - (Date.civil(2007,2,27) - Date.civil(2007,2,27)).should == 0 - (Date.civil(2007,2,27) - Date.civil(2007,2,26)).should == 1 - (Date.civil(2006,2,27) - Date.civil(2007,2,27)).should == -365 - (Date.civil(2008,2,27) - Date.civil(2007,2,27)).should == 365 - - end - - it "raises an error for non Numeric arguments" do - lambda { Date.civil(2007,2,27) - :hello }.should raise_error(TypeError) - lambda { Date.civil(2007,2,27) - "hello" }.should raise_error(TypeError) - lambda { Date.civil(2007,2,27) - Object.new }.should raise_error(TypeError) - end - -end diff --git a/spec/rubyspec/library/date/mjd_spec.rb b/spec/rubyspec/library/date/mjd_spec.rb deleted file mode 100644 index 7de39f0047..0000000000 --- a/spec/rubyspec/library/date/mjd_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#mjd" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/mjd_to_jd_spec.rb b/spec/rubyspec/library/date/mjd_to_jd_spec.rb deleted file mode 100644 index fdda1330e5..0000000000 --- a/spec/rubyspec/library/date/mjd_to_jd_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date.mjd_to_jd" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/mon_spec.rb b/spec/rubyspec/library/date/mon_spec.rb deleted file mode 100644 index c3508b53bf..0000000000 --- a/spec/rubyspec/library/date/mon_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#mon" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/month_spec.rb b/spec/rubyspec/library/date/month_spec.rb deleted file mode 100644 index 7a98f572b6..0000000000 --- a/spec/rubyspec/library/date/month_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#month" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/new_spec.rb b/spec/rubyspec/library/date/new_spec.rb deleted file mode 100644 index f468036a01..0000000000 --- a/spec/rubyspec/library/date/new_spec.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'date' -require File.expand_path('../../../spec_helper', __FILE__) -require File.expand_path('../shared/civil', __FILE__) -require File.expand_path('../shared/new_bang', __FILE__) - -describe "Date.new" do - it_behaves_like(:date_civil, :new) -end diff --git a/spec/rubyspec/library/date/new_start_spec.rb b/spec/rubyspec/library/date/new_start_spec.rb deleted file mode 100644 index 94ec6bee46..0000000000 --- a/spec/rubyspec/library/date/new_start_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#new_start" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/next_day_spec.rb b/spec/rubyspec/library/date/next_day_spec.rb deleted file mode 100644 index 1ccb4df257..0000000000 --- a/spec/rubyspec/library/date/next_day_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#next_day" do - it "returns the next day" do - d = Date.new(2000, 1, 5) - d1 = Date.new(2000, 1, 4).next_day - d1.should == d - end -end diff --git a/spec/rubyspec/library/date/next_spec.rb b/spec/rubyspec/library/date/next_spec.rb deleted file mode 100644 index d88d31e974..0000000000 --- a/spec/rubyspec/library/date/next_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#next" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/next_year_spec.rb b/spec/rubyspec/library/date/next_year_spec.rb deleted file mode 100644 index 70f2f7ab77..0000000000 --- a/spec/rubyspec/library/date/next_year_spec.rb +++ /dev/null @@ -1,12 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#next_year" do - it "returns the day of the reform if date falls within calendar reform" do - calendar_reform_italy = Date.new(1582, 10, 4) - d1 = Date.new(1581, 10, 9).next_year - d2 = Date.new(1581, 10, 10).next_year - d1.should == calendar_reform_italy - d2.should == calendar_reform_italy - end -end diff --git a/spec/rubyspec/library/date/ordinal_spec.rb b/spec/rubyspec/library/date/ordinal_spec.rb deleted file mode 100644 index a373692a7b..0000000000 --- a/spec/rubyspec/library/date/ordinal_spec.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'date' -require File.expand_path('../../../spec_helper', __FILE__) -require File.expand_path('../shared/ordinal', __FILE__) - -describe "Date.ordinal" do - it_behaves_like :date_ordinal, :ordinal -end - diff --git a/spec/rubyspec/library/date/ordinal_to_jd_spec.rb b/spec/rubyspec/library/date/ordinal_to_jd_spec.rb deleted file mode 100644 index 0a76c69c00..0000000000 --- a/spec/rubyspec/library/date/ordinal_to_jd_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date.ordinal_to_jd" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/parse_spec.rb b/spec/rubyspec/library/date/parse_spec.rb deleted file mode 100644 index 092c658809..0000000000 --- a/spec/rubyspec/library/date/parse_spec.rb +++ /dev/null @@ -1,137 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require File.expand_path('../shared/parse', __FILE__) -require File.expand_path('../shared/parse_us', __FILE__) -require File.expand_path('../shared/parse_eu', __FILE__) -require 'date' - -describe "Date#parse" do - # The space separator is also different, doesn't work for only numbers - it "parses a day name into a Date object" do - d = Date.parse("friday") - d.should == Date.commercial(d.cwyear, d.cweek, 5) - end - - it "parses a month name into a Date object" do - d = Date.parse("october") - d.should == Date.civil(Date.today.year, 10) - end - - it "parses a month day into a Date object" do - d = Date.parse("5th") - d.should == Date.civil(Date.today.year, Date.today.month, 5) - end - - # Specs using numbers - it "throws an argument error for a single digit" do - lambda{ Date.parse("1") }.should raise_error(ArgumentError) - end - - it "parses DD as month day number" do - d = Date.parse("10") - d.should == Date.civil(Date.today.year, Date.today.month, 10) - end - - it "parses DDD as year day number" do - d = Date.parse("100") - if Date.gregorian_leap?(Date.today.year) - d.should == Date.civil(Date.today.year, 4, 9) - else - d.should == Date.civil(Date.today.year, 4, 10) - end - end - - it "parses MMDD as month and day" do - d = Date.parse("1108") - d.should == Date.civil(Date.today.year, 11, 8) - end - - it "parses YYDDD as year and day number in 1969--2068" do - d = Date.parse("10100") - d.should == Date.civil(2010, 4, 10) - end - - it "parses YYMMDD as year, month and day in 1969--2068" do - d = Date.parse("201023") - d.should == Date.civil(2020, 10, 23) - end - - it "parses YYYYDDD as year and day number" do - d = Date.parse("1910100") - d.should == Date.civil(1910, 4, 10) - end - - it "parses YYYYMMDD as year, month and day number" do - d = Date.parse("19101101") - d.should == Date.civil(1910, 11, 1) - end -end - -describe "Date#parse with '.' separator" do - before :all do - @sep = '.' - end - - it_should_behave_like "date_parse" -end - -describe "Date#parse with '/' separator" do - before :all do - @sep = '/' - end - - it_should_behave_like "date_parse" -end - -describe "Date#parse with ' ' separator" do - before :all do - @sep = ' ' - end - - it_should_behave_like "date_parse" -end - -describe "Date#parse with '/' separator US-style" do - before :all do - @sep = '/' - end - - it_should_behave_like "date_parse_us" -end - -describe "Date#parse with '-' separator EU-style" do - before :all do - @sep = '-' - end - - it_should_behave_like "date_parse_eu" -end - -describe "Date#parse(.)" do - it "parses YYYY.MM.DD into a Date object" do - d = Date.parse("2007.10.01") - d.year.should == 2007 - d.month.should == 10 - d.day.should == 1 - end - - it "parses DD.MM.YYYY into a Date object" do - d = Date.parse("10.01.2007") - d.year.should == 2007 - d.month.should == 1 - d.day.should == 10 - end - - it "parses YY.MM.DD into a Date object using the year 20YY" do - d = Date.parse("10.01.07") - d.year.should == 2010 - d.month.should == 1 - d.day.should == 7 - end - - it "parses YY.MM.DD using the year digits as 20YY when given true as additional argument" do - d = Date.parse("10.01.07", true) - d.year.should == 2010 - d.month.should == 1 - d.day.should == 7 - end -end diff --git a/spec/rubyspec/library/date/plus_spec.rb b/spec/rubyspec/library/date/plus_spec.rb deleted file mode 100644 index e33fb199eb..0000000000 --- a/spec/rubyspec/library/date/plus_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#+" do - before :all do - @date = Date.civil(2000, 1, 1) - end - - it "returns a new Date object that is n days later than the current one" do - (@date + 31).should == Date.civil(2000, 2, 1) - end - - it "accepts a negative argument and returns a new Date that is earlier than the current one" do - (@date + -1).should == Date.civil(1999, 12, 31) - end - - it "raises TypeError if argument is not Numeric" do - lambda { Date.today + Date.today }.should raise_error(TypeError) - end -end diff --git a/spec/rubyspec/library/date/prev_year_spec.rb b/spec/rubyspec/library/date/prev_year_spec.rb deleted file mode 100644 index 4f27d1d1f9..0000000000 --- a/spec/rubyspec/library/date/prev_year_spec.rb +++ /dev/null @@ -1,12 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#prev_year" do - it "returns the day of the reform if date falls within calendar reform" do - calendar_reform_italy = Date.new(1582, 10, 4) - d1 = Date.new(1583, 10, 9).prev_year - d2 = Date.new(1583, 10, 10).prev_year - d1.should == calendar_reform_italy - d2.should == calendar_reform_italy - end -end diff --git a/spec/rubyspec/library/date/relationship_spec.rb b/spec/rubyspec/library/date/relationship_spec.rb deleted file mode 100644 index 7c09457228..0000000000 --- a/spec/rubyspec/library/date/relationship_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'date' -require File.expand_path('../../../spec_helper', __FILE__) - -describe "Date#===" do - - it "returns 0 when comparing two equal dates" do - (Date.civil(2000, 04, 06) <=> Date.civil(2000, 04, 06)).should == 0 - end - - it "computes the difference between two dates" do - (Date.civil(2000, 04, 05) <=> Date.civil(2000, 04, 06)).should == -1 - (Date.civil(2001, 04, 05) <=> Date.civil(2000, 04, 06)).should == 1 - end - - it "compares to another numeric" do - (Date.civil(2000, 04, 05) <=> Date.civil(2000, 04, 06).jd).should == -1 - (Date.civil(2001, 04, 05) <=> Date.civil(2000, 04, 06).jd).should == 1 - end - -end diff --git a/spec/rubyspec/library/date/right_shift_spec.rb b/spec/rubyspec/library/date/right_shift_spec.rb deleted file mode 100644 index 3d55e5abed..0000000000 --- a/spec/rubyspec/library/date/right_shift_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#>>" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/shared/civil.rb b/spec/rubyspec/library/date/shared/civil.rb deleted file mode 100644 index 47dbed49fc..0000000000 --- a/spec/rubyspec/library/date/shared/civil.rb +++ /dev/null @@ -1,57 +0,0 @@ -describe :date_civil, shared: true do - it "creates a Date for -4712 by default" do - # the #chomp calls are necessary because of RSpec - d = Date.send(@method) - d.year.should == -4712 - d.month.should == 1 - d.day.should == 1 - d.julian?.should == true - d.jd.should == 0 - end - - it "creates a date with arguments" do - d = Date.send(@method, 2000, 3, 5) - d.year.should == 2000 - d.month.should == 3 - d.day.should == 5 - d.julian?.should == false - d.jd.should == 2451609 - - # Should also work with years far in the past and future - - d = Date.send(@method, -9000, 7, 5) - d.year.should == -9000 - d.month.should == 7 - d.day.should == 5 - d.julian?.should == true - d.jd.should == -1566006 - - d = Date.send(@method, 9000, 10, 14) - d.year.should == 9000 - d.month.should == 10 - d.day.should == 14 - d.julian?.should == false - d.jd.should == 5008529 - - end - - it "doesn't create dates for invalid arguments" do - lambda { Date.send(@method, 2000, 13, 31) }.should raise_error(ArgumentError) - lambda { Date.send(@method, 2000, 12, 32) }.should raise_error(ArgumentError) - lambda { Date.send(@method, 2000, 2, 30) }.should raise_error(ArgumentError) - lambda { Date.send(@method, 1900, 2, 29) }.should raise_error(ArgumentError) - lambda { Date.send(@method, 2000, 2, 29) }.should_not raise_error(ArgumentError) - - lambda { Date.send(@method, 1582, 10, 14) }.should raise_error(ArgumentError) - lambda { Date.send(@method, 1582, 10, 15) }.should_not raise_error(ArgumentError) - - end - - it "creates a Date for different calendar reform dates" do - d1 = Date.send(@method, 1582, 10, 4) - d1.succ.day.should == 15 - - d2 = Date.send(@method, 1582, 10, 4, Date::ENGLAND) - d2.succ.day.should == 5 - end -end diff --git a/spec/rubyspec/library/date/shared/commercial.rb b/spec/rubyspec/library/date/shared/commercial.rb deleted file mode 100644 index 354a5d5cd0..0000000000 --- a/spec/rubyspec/library/date/shared/commercial.rb +++ /dev/null @@ -1,39 +0,0 @@ -describe :date_commercial, shared: true do - it "creates a Date for Julian Day Number day 0 by default" do - d = Date.send(@method) - d.year.should == -4712 - d.month.should == 1 - d.day.should == 1 - end - - it "creates a Date for the monday in the year and week given" do - d = Date.send(@method, 2000, 1) - d.year.should == 2000 - d.month.should == 1 - d.day.should == 3 - d.cwday.should == 1 - end - - it "creates a Date for the correct day given the year, week and day number" do - d = Date.send(@method, 2004, 1, 1) - d.year.should == 2003 - d.month.should == 12 - d.day.should == 29 - d.cwday.should == 1 - d.cweek.should == 1 - d.cwyear.should == 2004 - end - - it "creates only Date objects for valid weeks" do - lambda { Date.send(@method, 2004, 53, 1) }.should_not raise_error(ArgumentError) - lambda { Date.send(@method, 2004, 53, 0) }.should raise_error(ArgumentError) - lambda { Date.send(@method, 2004, 53, 8) }.should raise_error(ArgumentError) - lambda { Date.send(@method, 2004, 54, 1) }.should raise_error(ArgumentError) - lambda { Date.send(@method, 2004, 0, 1) }.should raise_error(ArgumentError) - - lambda { Date.send(@method, 2003, 52, 1) }.should_not raise_error(ArgumentError) - lambda { Date.send(@method, 2003, 53, 1) }.should raise_error(ArgumentError) - lambda { Date.send(@method, 2003, 52, 0) }.should raise_error(ArgumentError) - lambda { Date.send(@method, 2003, 52, 8) }.should raise_error(ArgumentError) - end -end diff --git a/spec/rubyspec/library/date/shared/jd.rb b/spec/rubyspec/library/date/shared/jd.rb deleted file mode 100644 index 511557b4f7..0000000000 --- a/spec/rubyspec/library/date/shared/jd.rb +++ /dev/null @@ -1,14 +0,0 @@ -describe :date_jd, shared: true do - it "constructs a Date object if passed a Julian day" do - Date.send(@method, 2454482).should == Date.civil(2008, 1, 16) - end - - it "returns a Date object representing Julian day 0 (-4712-01-01) if no arguments passed" do - Date.send(@method).should == Date.civil(-4712, 1, 1) - end - - it "constructs a Date object if passed a negative number" do - Date.send(@method, -1).should == Date.civil(-4713, 12, 31) - end - -end diff --git a/spec/rubyspec/library/date/shared/new_bang.rb b/spec/rubyspec/library/date/shared/new_bang.rb deleted file mode 100644 index 90f1b432f0..0000000000 --- a/spec/rubyspec/library/date/shared/new_bang.rb +++ /dev/null @@ -1,14 +0,0 @@ -describe :date_new_bang, shared: true do - - it "returns a new Date object set to Astronomical Julian Day 0 if no arguments passed" do - d = Date.send(@method) - d.ajd.should == 0 - end - - it "accepts astronomical julian day number, offset as a fraction of a day and returns a new Date object" do - d = Date.send(@method, 10, 0.5) - d.ajd.should == 10 - d.jd.should == 11 - end - -end diff --git a/spec/rubyspec/library/date/shared/ordinal.rb b/spec/rubyspec/library/date/shared/ordinal.rb deleted file mode 100644 index 4b182d5a25..0000000000 --- a/spec/rubyspec/library/date/shared/ordinal.rb +++ /dev/null @@ -1,22 +0,0 @@ -# reference: -# October 1582 (the Gregorian calendar, Civil Date) -# S M Tu W Th F S -# 1 2 3 4 15 16 -# 17 18 19 20 21 22 23 -# 24 25 26 27 28 29 30 -# 31 - -describe :date_ordinal, shared: true do - it "constructs a Date object from an ordinal date" do - # October 1582 (the Gregorian calendar, Ordinal Date) - # S M Tu W Th F S - # 274 275 276 277 278 279 - # 280 281 282 283 284 285 286 - # 287 288 289 290 291 292 293 - # 294 - Date.send(@method, 1582, 274).should == Date.civil(1582, 10, 1) - Date.send(@method, 1582, 277).should == Date.civil(1582, 10, 4) - Date.send(@method, 1582, 278).should == Date.civil(1582, 10, 15) - Date.send(@method, 1582, 287, Date::ENGLAND).should == Date.civil(1582, 10, 14, Date::ENGLAND) - end -end diff --git a/spec/rubyspec/library/date/shared/parse.rb b/spec/rubyspec/library/date/shared/parse.rb deleted file mode 100644 index 1015285e04..0000000000 --- a/spec/rubyspec/library/date/shared/parse.rb +++ /dev/null @@ -1,54 +0,0 @@ -describe :date_parse, shared: true do - it "can parse a mmm-YYYY string into a Date object" do - d = Date.parse("feb#{@sep}2008") - d.year.should == 2008 - d.month.should == 2 - d.day.should == 1 - end - - it "can parse a 'DD mmm YYYY' string into a Date object" do - d = Date.parse("23#{@sep}feb#{@sep}2008") - d.year.should == 2008 - d.month.should == 2 - d.day.should == 23 - end - - it "can parse a 'mmm DD YYYY' string into a Date object" do - d = Date.parse("23#{@sep}feb#{@sep}2008") - d.year.should == 2008 - d.month.should == 2 - d.day.should == 23 - end - - it "can parse a 'YYYY mmm DD' string into a Date object" do - d = Date.parse("2008#{@sep}feb#{@sep}23") - d.year.should == 2008 - d.month.should == 2 - d.day.should == 23 - end - - it "can parse a month name and day into a Date object" do - d = Date.parse("november#{@sep}5th") - d.should == Date.civil(Date.today.year, 11, 5) - end - - it "can parse a month name, day and year into a Date object" do - d = Date.parse("november#{@sep}5th#{@sep}2005") - d.should == Date.civil(2005, 11, 5) - end - - it "can parse a year, month name and day into a Date object" do - d = Date.parse("2005#{@sep}november#{@sep}5th") - d.should == Date.civil(2005, 11, 5) - end - - it "can parse a year, day and month name into a Date object" do - d = Date.parse("5th#{@sep}november#{@sep}2005") - d.should == Date.civil(2005, 11, 5) - end - - it "can handle negative year numbers" do - d = Date.parse("5th#{@sep}november#{@sep}-2005") - d.should == Date.civil(-2005, 11, 5) - end -end diff --git a/spec/rubyspec/library/date/shared/parse_eu.rb b/spec/rubyspec/library/date/shared/parse_eu.rb deleted file mode 100644 index ecb15e3c0e..0000000000 --- a/spec/rubyspec/library/date/shared/parse_eu.rb +++ /dev/null @@ -1,37 +0,0 @@ -describe :date_parse_eu, shared: true do - # The - separator let's it work like European format, so it as a different spec - it "can parse a YYYY-MM-DD string into a Date object" do - d = Date.parse("2007#{@sep}10#{@sep}01") - d.year.should == 2007 - d.month.should == 10 - d.day.should == 1 - end - - it "can parse a MM-DD-YYYY string into a Date object" do - d = Date.parse("10#{@sep}01#{@sep}2007") - d.year.should == 2007 - d.month.should == 1 - d.day.should == 10 - end - - it "can parse a MM-DD-YY string into a Date object" do - d = Date.parse("10#{@sep}01#{@sep}07") - d.year.should == 2010 - d.month.should == 1 - d.day.should == 7 - end - - it "can parse a MM-DD-YY string into a Date object NOT using the year digits as 20XX" do - d = Date.parse("10#{@sep}01#{@sep}07", false) - d.year.should == 10 - d.month.should == 1 - d.day.should == 7 - end - - it "can parse a MM-DD-YY string into a Date object using the year digits as 20XX" do - d = Date.parse("10#{@sep}01#{@sep}07", true) - d.year.should == 2010 - d.month.should == 1 - d.day.should == 7 - end -end diff --git a/spec/rubyspec/library/date/shared/parse_us.rb b/spec/rubyspec/library/date/shared/parse_us.rb deleted file mode 100644 index 7be62b1af1..0000000000 --- a/spec/rubyspec/library/date/shared/parse_us.rb +++ /dev/null @@ -1,36 +0,0 @@ -describe :date_parse_us, shared: true do - it "parses a YYYY#{@sep}MM#{@sep}DD string into a Date object" do - d = Date.parse("2007#{@sep}10#{@sep}01") - d.year.should == 2007 - d.month.should == 10 - d.day.should == 1 - end - - it "parses a MM#{@sep}DD#{@sep}YYYY string into a Date object" do - d = Date.parse("10#{@sep}01#{@sep}2007") - d.year.should == 2007 - d.month.should == 1 - d.day.should == 10 - end - - it "parses a MM#{@sep}DD#{@sep}YY string into a Date object" do - d = Date.parse("10#{@sep}01#{@sep}07") - d.year.should == 2010 - d.month.should == 1 - d.day.should == 7 - end - - it "parses a MM#{@sep}DD#{@sep}YY string into a Date object NOT using the year digits as 20XX" do - d = Date.parse("10#{@sep}01#{@sep}07", false) - d.year.should == 10 - d.month.should == 1 - d.day.should == 7 - end - - it "parses a MM#{@sep}DD#{@sep}YY string into a Date object using the year digits as 20XX" do - d = Date.parse("10#{@sep}01#{@sep}07", true) - d.year.should == 2010 - d.month.should == 1 - d.day.should == 7 - end -end diff --git a/spec/rubyspec/library/date/shared/valid_civil.rb b/spec/rubyspec/library/date/shared/valid_civil.rb deleted file mode 100644 index 545c207bbe..0000000000 --- a/spec/rubyspec/library/date/shared/valid_civil.rb +++ /dev/null @@ -1,36 +0,0 @@ -describe :date_valid_civil?, shared: true do - - # reference: - # October 1582 (the Gregorian calendar, Civil Date) - # S M Tu W Th F S - # 1 2 3 4 15 16 - # 17 18 19 20 21 22 23 - # 24 25 26 27 28 29 30 - # 31 - - it "returns true if it is a valid civil date" do - Date.send(@method, 1582, 10, 15).should be_true - Date.send(@method, 1582, 10, 14, Date::ENGLAND).should be_true - end - - it "returns false if it is not a valid civil date" do - Date.send(@method, 1582, 10, 14).should == false - end - - it "handles negative months and days" do - # October 1582 (the Gregorian calendar, Civil Date) - # S M Tu W Th F S - # -21 -20 -19 -18 -17 -16 - # -15 -14 -13 -12 -11 -10 -9 - # -8 -7 -6 -5 -4 -3 -2 - # -1 - Date.send(@method, 1582, -3, -22).should be_false - Date.send(@method, 1582, -3, -21).should be_true - Date.send(@method, 1582, -3, -18).should be_true - Date.send(@method, 1582, -3, -17).should be_true - - Date.send(@method, 2007, -11, -10).should be_true - Date.send(@method, 2008, -11, -10).should be_true - end - -end diff --git a/spec/rubyspec/library/date/shared/valid_commercial.rb b/spec/rubyspec/library/date/shared/valid_commercial.rb deleted file mode 100644 index 117dfe1d3d..0000000000 --- a/spec/rubyspec/library/date/shared/valid_commercial.rb +++ /dev/null @@ -1,34 +0,0 @@ -describe :date_valid_commercial?, shared: true do - - it "returns true if it is a valid commercial date" do - # October 1582 (the Gregorian calendar, Commercial Date) - # M Tu W Th F Sa Su - # 39: 1 2 3 4 5 6 7 - # 40: 1 2 3 4 5 6 7 - # 41: 1 2 3 4 5 6 7 - Date.send(@method, 1582, 39, 4).should be_true - Date.send(@method, 1582, 39, 5).should be_true - Date.send(@method, 1582, 41, 4).should be_true - Date.send(@method, 1582, 41, 5).should be_true - Date.send(@method, 1582, 41, 4, Date::ENGLAND).should be_true - Date.send(@method, 1752, 37, 4, Date::ENGLAND).should be_true - end - - it "returns false it is not a valid commercial date" do - Date.send(@method, 1999, 53, 1).should be_false - end - - it "handles negative week and day numbers" do - # October 1582 (the Gregorian calendar, Commercial Date) - # M Tu W Th F Sa Su - # -12: -7 -6 -5 -4 -3 -2 -1 - # -11: -7 -6 -5 -4 -3 -2 -1 - # -10: -7 -6 -5 -4 -3 -2 -1 - Date.send(@method, 1582, -12, -4).should be_true - Date.send(@method, 1582, -12, -3).should be_true - Date.send(@method, 2007, -44, -2).should be_true - Date.send(@method, 2008, -44, -2).should be_true - Date.send(@method, 1999, -53, -1).should be_false - end - -end diff --git a/spec/rubyspec/library/date/shared/valid_jd.rb b/spec/rubyspec/library/date/shared/valid_jd.rb deleted file mode 100644 index d8a35992b3..0000000000 --- a/spec/rubyspec/library/date/shared/valid_jd.rb +++ /dev/null @@ -1,15 +0,0 @@ -describe :date_valid_jd?, shared: true do - it "returns true if passed any value other than nil" do - Date.send(@method, -100).should be_true - Date.send(@method, :number).should be_true - Date.send(@method, Rational(1,2)).should be_true - end - - it "returns false if passed nil" do - Date.send(@method, nil).should be_false - end - - it "returns true if passed false" do - Date.send(@method, false).should be_true - end -end diff --git a/spec/rubyspec/library/date/shared/valid_ordinal.rb b/spec/rubyspec/library/date/shared/valid_ordinal.rb deleted file mode 100644 index 1ed961be23..0000000000 --- a/spec/rubyspec/library/date/shared/valid_ordinal.rb +++ /dev/null @@ -1,26 +0,0 @@ -describe :date_valid_ordinal?, shared: true do - it "determines if the date is a valid ordinal date" do - # October 1582 (the Gregorian calendar, Ordinal Date) - # S M Tu W Th F S - # 274 275 276 277 278 279 - # 280 281 282 283 284 285 286 - # 287 288 289 290 291 292 293 - # 294 - Date.send(@method, 1582, 277).should == true - Date.send(@method, 1582, 278).should == true - Date.send(@method, 1582, 287).should == true - Date.send(@method, 1582, 288).should == true - end - - it "handles negative day numbers" do - # October 1582 (the Gregorian calendar, Ordinal Date) - # S M Tu W Th F S - # -82 -81 -80 -79 -78 -77 - # -76 -75 -74 -73 -72 -71 -70 - # -69 -68 -67 -66 -65 -64 -63 - # -62 - Date.send(@method, 1582, -79).should == true - Date.send(@method, 1582, -78).should == true - Date.send(@method, 2007, -100).should == true - end -end diff --git a/spec/rubyspec/library/date/start_spec.rb b/spec/rubyspec/library/date/start_spec.rb deleted file mode 100644 index 285037b094..0000000000 --- a/spec/rubyspec/library/date/start_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#start" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/step_spec.rb b/spec/rubyspec/library/date/step_spec.rb deleted file mode 100644 index 249633e807..0000000000 --- a/spec/rubyspec/library/date/step_spec.rb +++ /dev/null @@ -1,56 +0,0 @@ -require 'date' -require File.expand_path('../../../spec_helper', __FILE__) - -describe "Date#step" do - - it "steps forward in time" do - ds = Date.civil(2008, 10, 11) - de = Date.civil(2008, 9, 29) - count = 0 - de.step(ds) do |d| - d.should <= ds - d.should >= de - count += 1 - end - count.should == 13 - - count = 0 - de.step(ds, 5) do |d| - d.should <= ds - d.should >= de - count += 1 - end - count.should == 3 - - count = 0 - ds.step(de) do |d|; count += 1; end - count.should == 0 - - end - - it "steps backward in time" do - ds = Date.civil(2000, 4, 14) - de = Date.civil(2000, 3, 29) - count = 0 - ds.step(de, -1) do |d| - d.should <= ds - d.should >= de - count += 1 - end - count.should == 17 - - count = 0 - ds.step(de, -5) do |d| - d.should <= ds - d.should >= de - count += 1 - end - count.should == 4 - - count = 0 - de.step(ds, -1) do |d|; count += 1; end - count.should == 0 - - end - -end diff --git a/spec/rubyspec/library/date/strftime_spec.rb b/spec/rubyspec/library/date/strftime_spec.rb deleted file mode 100644 index 81bb162ff7..0000000000 --- a/spec/rubyspec/library/date/strftime_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -require 'date' -require File.expand_path('../../../shared/time/strftime_for_date', __FILE__) - -describe "Date#strftime" do - before :all do - @new_date = lambda { |y,m,d| Date.civil(y,m,d) } - - @date = Date.civil(2000, 4, 9) - end - - it_behaves_like :strftime_date, :strftime - - # Differences with Time - it "should be able to print the date with no argument" do - @date.strftime.should == "2000-04-09" - @date.strftime.should == @date.to_s - end - - # %Z is %:z for Date/DateTime - it "should be able to show the timezone with a : separator" do - @date.strftime("%Z").should == "+00:00" - end - - # %v is %e-%b-%Y for Date/DateTime - it "should be able to show the commercial week" do - @date.strftime("%v").should == " 9-Apr-2000" - @date.strftime("%v").should == @date.strftime('%e-%b-%Y') - end - - # additional conversion specifiers only in Date/DateTime - it 'shows the number of milliseconds since epoch' do - DateTime.new(1970, 1, 1).strftime('%Q').should == "0" - @date.strftime("%Q").should == "955238400000" - end - - it "should be able to show a full notation" do - @date.strftime("%+").should == "Sun Apr 9 00:00:00 +00:00 2000" - @date.strftime("%+").should == @date.strftime('%a %b %e %H:%M:%S %Z %Y') - end -end diff --git a/spec/rubyspec/library/date/strptime_spec.rb b/spec/rubyspec/library/date/strptime_spec.rb deleted file mode 100644 index 21a73da086..0000000000 --- a/spec/rubyspec/library/date/strptime_spec.rb +++ /dev/null @@ -1,149 +0,0 @@ -require 'date' -require File.expand_path('../../../spec_helper', __FILE__) - -describe "Date#strptime" do - - it "returns January 1, 4713 BCE when given no arguments" do - Date.strptime.should == Date.civil(-4712, 1, 1) - end - - it "uses the default format when not given a date format" do - Date.strptime("2000-04-06").should == Date.civil(2000, 4, 6) - Date.civil(2000, 4, 6).strftime.should == Date.civil(2000, 4, 6).to_s - end - - it "parses a full day name" do - d = Date.today - expected_date = Date.commercial(d.cwyear, d.cweek, 4) - # strptime assumed week that start on sunday, not monday - expected_date += 7 if d.cwday == 7 - Date.strptime("Thursday", "%A").should == expected_date - end - - it "parses a short day name" do - d = Date.today - expected_date = Date.commercial(d.cwyear, d.cweek, 4) - # strptime assumed week that start on sunday, not monday - expected_date += 7 if d.cwday == 7 - Date.strptime("Thu", "%a").should == expected_date - end - - it "parses a full month name" do - d = Date.today - Date.strptime("April", "%B").should == Date.civil(d.year, 4, 1) - end - - it "parses a short month name" do - d = Date.today - Date.strptime("Apr", "%b").should == Date.civil(d.year, 4, 1) - Date.strptime("Apr", "%h").should == Date.civil(d.year, 4, 1) - end - - it "parses a century" do - Date.strptime("06 20", "%y %C").should == Date.civil(2006, 1, 1) - end - - it "parses a month day with leading zeroes" do - d = Date.today - Date.strptime("06", "%d").should == Date.civil(d.year, d.month, 6) - end - - it "parses a month day with leading spaces" do - d = Date.today - Date.strptime(" 6", "%e").should == Date.civil(d.year, d.month, 6) - end - - it "parses a commercial year with leading zeroes" do - Date.strptime("2000", "%G").should == Date.civil(2000, 1, 3) - Date.strptime("2002", "%G").should == Date.civil(2001, 12, 31) - end - - it "parses a commercial year with only two digits" do - Date.strptime("68", "%g").should == Date.civil(2068, 1, 2) - Date.strptime("69", "%g").should == Date.civil(1968, 12, 30) - end - - it "parses a year day with leading zeroes" do - d = Date.today - if Date.gregorian_leap?(Date.today.year) - Date.strptime("097", "%j").should == Date.civil(d.year, 4, 6) - else - Date.strptime("097", "%j").should == Date.civil(d.year, 4, 7) - end - end - - it "parses a month with leading zeroes" do - d = Date.today - Date.strptime("04", "%m").should == Date.civil(d.year, 4, 1) - end - - it "parses a week number for a week starting on Sunday" do - Date.strptime("2010/1", "%Y/%U").should == Date.civil(2010, 1, 3) - end - - # See http://redmine.ruby-lang.org/repositories/diff/ruby-19?rev=24500 - it "parses a week number for a week starting on Monday" do - Date.strptime("2010/1", "%Y/%W").should == Date.civil(2010, 1, 4) - end - - it "parses a commercial week day" do - Date.strptime("2008 1", "%G %u").should == Date.civil(2007, 12, 31) - end - - it "parses a commercial week" do - 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 - - it "parses a week day" do - Date.strptime("2007 4", "%Y %w").should == Date.civil(2007, 1, 4) - end - - it "parses a year in YYYY format" do - Date.strptime("2007", "%Y").should == Date.civil(2007, 1, 1) - end - - it "parses a year in YY format" do - Date.strptime("00", "%y").should == Date.civil(2000, 1, 1) - end - - ############################ - # Specs that combine stuff # - ############################ - - it "parses a full date" do - Date.strptime("Thu Apr 6 00:00:00 2000", "%c").should == Date.civil(2000, 4, 6) - Date.strptime("Thu Apr 6 00:00:00 2000", "%a %b %e %H:%M:%S %Y").should == Date.civil(2000, 4, 6) - end - - it "parses a date with slashes" do - Date.strptime("04/06/00", "%D").should == Date.civil(2000, 4, 6) - Date.strptime("04/06/00", "%m/%d/%y").should == Date.civil(2000, 4, 6) - end - - it "parses a date given as YYYY-MM-DD" do - Date.strptime("2000-04-06", "%F").should == Date.civil(2000, 4, 6) - Date.strptime("2000-04-06", "%Y-%m-%d").should == Date.civil(2000, 4, 6) - end - - it "parses a commercial week" do - Date.strptime(" 9-Apr-2000", "%v").should == Date.civil(2000, 4, 9) - Date.strptime(" 9-Apr-2000", "%e-%b-%Y").should == Date.civil(2000, 4, 9) - end - - it "parses a date given MM/DD/YY" do - Date.strptime("04/06/00", "%x").should == Date.civil(2000, 4, 6) - Date.strptime("04/06/00", "%m/%d/%y").should == Date.civil(2000, 4, 6) - end - - it "parses a date given in full notation" do - Date.strptime("Sun Apr 9 00:00:00 +00:00 2000", "%+").should == Date.civil(2000, 4, 9) - Date.strptime("Sun Apr 9 00:00:00 +00:00 2000", "%a %b %e %H:%M:%S %Z %Y").should == Date.civil(2000, 4, 9) - end - -end - -describe "Date.strptime" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/succ_spec.rb b/spec/rubyspec/library/date/succ_spec.rb deleted file mode 100644 index 2650810e73..0000000000 --- a/spec/rubyspec/library/date/succ_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#succ" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/time_to_day_fraction_spec.rb b/spec/rubyspec/library/date/time_to_day_fraction_spec.rb deleted file mode 100644 index 06d477b601..0000000000 --- a/spec/rubyspec/library/date/time_to_day_fraction_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date.time_to_day_fraction" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/to_s_spec.rb b/spec/rubyspec/library/date/to_s_spec.rb deleted file mode 100644 index a81297d689..0000000000 --- a/spec/rubyspec/library/date/to_s_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#to_s" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/today_spec.rb b/spec/rubyspec/library/date/today_spec.rb deleted file mode 100644 index 09e8ed6006..0000000000 --- a/spec/rubyspec/library/date/today_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date.today" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/upto_spec.rb b/spec/rubyspec/library/date/upto_spec.rb deleted file mode 100644 index c99aabd1d7..0000000000 --- a/spec/rubyspec/library/date/upto_spec.rb +++ /dev/null @@ -1,16 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#upto" do - it "returns future dates for the default step value" do - ds = Date.civil(2008, 10, 11) - de = Date.civil(2008, 9, 29) - count = 0 - de.upto(ds) do |d| - d.should <= ds - d.should >= de - count += 1 - end - count.should == 13 - end -end diff --git a/spec/rubyspec/library/date/valid_civil_spec.rb b/spec/rubyspec/library/date/valid_civil_spec.rb deleted file mode 100644 index 09185674ee..0000000000 --- a/spec/rubyspec/library/date/valid_civil_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require File.expand_path('../shared/valid_civil', __FILE__) -require 'date' - -describe "Date#valid_civil?" do - - it_behaves_like :date_valid_civil?, :valid_civil? - -end - diff --git a/spec/rubyspec/library/date/valid_commercial_spec.rb b/spec/rubyspec/library/date/valid_commercial_spec.rb deleted file mode 100644 index 187d818233..0000000000 --- a/spec/rubyspec/library/date/valid_commercial_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require File.expand_path('../shared/valid_commercial', __FILE__) -require 'date' - -describe "Date#valid_commercial?" do - - it_behaves_like :date_valid_commercial?, :valid_commercial? -end - - diff --git a/spec/rubyspec/library/date/valid_date_spec.rb b/spec/rubyspec/library/date/valid_date_spec.rb deleted file mode 100644 index ffaf007cd1..0000000000 --- a/spec/rubyspec/library/date/valid_date_spec.rb +++ /dev/null @@ -1,7 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require File.expand_path('../shared/valid_civil', __FILE__) -require 'date' - -describe "Date#valid_date?" do - it_behaves_like :date_valid_civil?, :valid_date? -end diff --git a/spec/rubyspec/library/date/valid_jd_spec.rb b/spec/rubyspec/library/date/valid_jd_spec.rb deleted file mode 100644 index 9764c02f2b..0000000000 --- a/spec/rubyspec/library/date/valid_jd_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require File.expand_path('../shared/valid_jd', __FILE__) -require 'date' - -describe "Date.valid_jd?" do - - it_behaves_like :date_valid_jd?, :valid_jd? - -end - diff --git a/spec/rubyspec/library/date/valid_ordinal_spec.rb b/spec/rubyspec/library/date/valid_ordinal_spec.rb deleted file mode 100644 index e197bb2051..0000000000 --- a/spec/rubyspec/library/date/valid_ordinal_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require File.expand_path('../shared/valid_ordinal', __FILE__) -require 'date' - -describe "Date.valid_ordinal?" do - - it_behaves_like :date_valid_ordinal?, :valid_ordinal? - -end - diff --git a/spec/rubyspec/library/date/valid_time_spec.rb b/spec/rubyspec/library/date/valid_time_spec.rb deleted file mode 100644 index e96f9041b7..0000000000 --- a/spec/rubyspec/library/date/valid_time_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date.valid_time?" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/wday_spec.rb b/spec/rubyspec/library/date/wday_spec.rb deleted file mode 100644 index 1d40b0c96c..0000000000 --- a/spec/rubyspec/library/date/wday_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#wday" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/yday_spec.rb b/spec/rubyspec/library/date/yday_spec.rb deleted file mode 100644 index 92bf616406..0000000000 --- a/spec/rubyspec/library/date/yday_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#yday" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/year_spec.rb b/spec/rubyspec/library/date/year_spec.rb deleted file mode 100644 index cca95dbe2a..0000000000 --- a/spec/rubyspec/library/date/year_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date#year" do - it "needs to be reviewed for spec completeness" -end diff --git a/spec/rubyspec/library/date/zone_to_diff_spec.rb b/spec/rubyspec/library/date/zone_to_diff_spec.rb deleted file mode 100644 index a39de0b58e..0000000000 --- a/spec/rubyspec/library/date/zone_to_diff_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require 'date' - -describe "Date.zone_to_diff" do - it "needs to be reviewed for spec completeness" -end |