summaryrefslogtreecommitdiff
path: root/spec/rubyspec/library/datetime
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-20 20:18:52 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-20 20:18:52 +0000
commit1d15d5f08032acf1b7bceacbb450d617ff6e0931 (patch)
treea3785a79899302bc149e4a6e72f624ac27dc1f10 /spec/rubyspec/library/datetime
parent75bfc6440d595bf339007f4fb280fd4d743e89c1 (diff)
Move spec/rubyspec to spec/ruby for consistency
* Other ruby implementations use the spec/ruby directory. [Misc #13792] [ruby-core:82287] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/rubyspec/library/datetime')
-rw-r--r--spec/rubyspec/library/datetime/_strptime_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/civil_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/commercial_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/hour_spec.rb47
-rw-r--r--spec/rubyspec/library/datetime/httpdate_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/iso8601_spec.rb10
-rw-r--r--spec/rubyspec/library/datetime/jd_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/jisx0301_spec.rb10
-rw-r--r--spec/rubyspec/library/datetime/min_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/minute_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/new_offset_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/new_spec.rb52
-rw-r--r--spec/rubyspec/library/datetime/now_spec.rb8
-rw-r--r--spec/rubyspec/library/datetime/offset_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/ordinal_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/parse_spec.rb127
-rw-r--r--spec/rubyspec/library/datetime/rfc2822_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/rfc3339_spec.rb10
-rw-r--r--spec/rubyspec/library/datetime/rfc822_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/sec_fraction_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/sec_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/second_fraction_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/second_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/shared/min.rb40
-rw-r--r--spec/rubyspec/library/datetime/shared/sec.rb45
-rw-r--r--spec/rubyspec/library/datetime/strftime_spec.rb51
-rw-r--r--spec/rubyspec/library/datetime/strptime_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/to_date_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/to_datetime_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/to_s_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/to_time_spec.rb6
-rw-r--r--spec/rubyspec/library/datetime/xmlschema_spec.rb10
-rw-r--r--spec/rubyspec/library/datetime/zone_spec.rb6
33 files changed, 0 insertions, 542 deletions
diff --git a/spec/rubyspec/library/datetime/_strptime_spec.rb b/spec/rubyspec/library/datetime/_strptime_spec.rb
deleted file mode 100644
index c8c910618d..0000000000
--- a/spec/rubyspec/library/datetime/_strptime_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime._strptime" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/civil_spec.rb b/spec/rubyspec/library/datetime/civil_spec.rb
deleted file mode 100644
index 77df021e33..0000000000
--- a/spec/rubyspec/library/datetime/civil_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime.civil" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/commercial_spec.rb b/spec/rubyspec/library/datetime/commercial_spec.rb
deleted file mode 100644
index 2984dd5334..0000000000
--- a/spec/rubyspec/library/datetime/commercial_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime.commercial" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/hour_spec.rb b/spec/rubyspec/library/datetime/hour_spec.rb
deleted file mode 100644
index db89016937..0000000000
--- a/spec/rubyspec/library/datetime/hour_spec.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime#hour" do
- it "returns 0 if no argument is passed" do
- DateTime.new.hour.should == 0
- end
-
- it "returns the hour given as argument" do
- new_datetime(hour: 5).hour.should == 5
- end
-
- it "adds 24 to negative hours" do
- new_datetime(hour: -10).hour.should == 14
- end
-
- it "raises an error for Rational" do
- lambda { new_datetime(hour: 1 + Rational(1,2)) }.should raise_error(ArgumentError)
- end
-
- it "raises an error for Float" do
- lambda { new_datetime(hour: 1.5).hour }.should raise_error(ArgumentError)
- end
-
- it "raises an error for Rational" do
- lambda { new_datetime(day: 1 + Rational(1,2)) }.should raise_error(ArgumentError)
- end
-
- it "raises an error, when the hour is smaller than -24" do
- lambda { new_datetime(hour: -25) }.should raise_error(ArgumentError)
- end
-
- it "raises an error, when the hour is larger than 24" do
- lambda { new_datetime(hour: 25) }.should raise_error(ArgumentError)
- end
-
- it "raises an error for hour fractions smaller than -24" do
- lambda { new_datetime(hour: -24 - Rational(1,2)) }.should(
- raise_error(ArgumentError))
- end
-
- it "adds 1 to day, when 24 hours given" do
- d = new_datetime day: 1, hour: 24
- d.hour.should == 0
- d.day.should == 2
- end
-end
diff --git a/spec/rubyspec/library/datetime/httpdate_spec.rb b/spec/rubyspec/library/datetime/httpdate_spec.rb
deleted file mode 100644
index e97fda7fb4..0000000000
--- a/spec/rubyspec/library/datetime/httpdate_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime.httpdate" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/iso8601_spec.rb b/spec/rubyspec/library/datetime/iso8601_spec.rb
deleted file mode 100644
index 44887148d3..0000000000
--- a/spec/rubyspec/library/datetime/iso8601_spec.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime.iso8601" do
- it "needs to be reviewed for spec completeness"
-end
-
-describe "DateTime#iso8601" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/jd_spec.rb b/spec/rubyspec/library/datetime/jd_spec.rb
deleted file mode 100644
index e8271089f7..0000000000
--- a/spec/rubyspec/library/datetime/jd_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime.jd" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/jisx0301_spec.rb b/spec/rubyspec/library/datetime/jisx0301_spec.rb
deleted file mode 100644
index 2402a21cb0..0000000000
--- a/spec/rubyspec/library/datetime/jisx0301_spec.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime.jisx0301" do
- it "needs to be reviewed for spec completeness"
-end
-
-describe "DateTime#jisx0301" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/min_spec.rb b/spec/rubyspec/library/datetime/min_spec.rb
deleted file mode 100644
index 5f7d7e7810..0000000000
--- a/spec/rubyspec/library/datetime/min_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/min', __FILE__)
-
-describe "DateTime.min" do
- it_behaves_like :datetime_min, :min
-end
diff --git a/spec/rubyspec/library/datetime/minute_spec.rb b/spec/rubyspec/library/datetime/minute_spec.rb
deleted file mode 100644
index 3ab01572fe..0000000000
--- a/spec/rubyspec/library/datetime/minute_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/min', __FILE__)
-
-describe "DateTime.minute" do
- it_behaves_like :datetime_min, :minute
-end
diff --git a/spec/rubyspec/library/datetime/new_offset_spec.rb b/spec/rubyspec/library/datetime/new_offset_spec.rb
deleted file mode 100644
index b900de6097..0000000000
--- a/spec/rubyspec/library/datetime/new_offset_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime#new_offset" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/new_spec.rb b/spec/rubyspec/library/datetime/new_spec.rb
deleted file mode 100644
index a8275a1951..0000000000
--- a/spec/rubyspec/library/datetime/new_spec.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime.new" do
- it "sets all values to default if passed no arguments" do
- d = DateTime.new
- d.year.should == -4712
- d.month.should == 1
- d.day.should == 1
- d.hour.should == 0
- d.min.should == 0
- d.sec.should == 0
- d.sec_fraction.should == 0
- d.offset.should == 0
- end
-
- it "takes the first argument as year" do
- DateTime.new(2011).year.should == 2011
- end
-
- it "takes the second argument as month" do
- DateTime.new(2011, 2).month.should == 2
- end
-
- it "takes the third argument as day" do
- DateTime.new(2011, 2, 3).day.should == 3
- end
-
- it "takes the forth argument as hour" do
- DateTime.new(2011, 2, 3, 4).hour.should == 4
- end
-
- it "takes the fifth argument as minute" do
- DateTime.new(1, 2, 3, 4, 5).min.should == 5
- end
-
- it "takes the sixth argument as second" do
- DateTime.new(1, 2, 3, 4, 5, 6).sec.should == 6
- end
-
- it "takes the seventh argument as an offset" do
- DateTime.new(1, 2, 3, 4, 5, 6, 0.7).offset.should == 0.7
- end
-
- it "takes the eigth argument as the date of calendar reform" do
- DateTime.new(1, 2, 3, 4, 5, 6, 0.7, Date::ITALY).start().should == Date::ITALY
- end
-
- it "raises an error on invalid arguments" do
- lambda { new_datetime(minute: 999) }.should raise_error(ArgumentError)
- end
-end
diff --git a/spec/rubyspec/library/datetime/now_spec.rb b/spec/rubyspec/library/datetime/now_spec.rb
deleted file mode 100644
index e8c93aa604..0000000000
--- a/spec/rubyspec/library/datetime/now_spec.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime.now" do
- it "creates an instance of DateTime" do
- DateTime.now.should be_an_instance_of(DateTime)
- end
-end
diff --git a/spec/rubyspec/library/datetime/offset_spec.rb b/spec/rubyspec/library/datetime/offset_spec.rb
deleted file mode 100644
index c11d28bad2..0000000000
--- a/spec/rubyspec/library/datetime/offset_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime#offset" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/ordinal_spec.rb b/spec/rubyspec/library/datetime/ordinal_spec.rb
deleted file mode 100644
index 2ada512e05..0000000000
--- a/spec/rubyspec/library/datetime/ordinal_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime.ordinal" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/parse_spec.rb b/spec/rubyspec/library/datetime/parse_spec.rb
deleted file mode 100644
index 14a68f1499..0000000000
--- a/spec/rubyspec/library/datetime/parse_spec.rb
+++ /dev/null
@@ -1,127 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime.parse" do
-
- it "parses a day name into a DateTime object" do
- d = DateTime.parse("friday")
- d.should == DateTime.commercial(d.cwyear, d.cweek, 5)
- end
-
- it "parses a month name into a DateTime object" do
- d = DateTime.parse("october")
- d.should == DateTime.civil(Date.today.year, 10)
- end
-
- it "parses a month day into a DateTime object" do
- d = DateTime.parse("5th")
- d.should == DateTime.civil(Date.today.year, Date.today.month, 5)
- end
-
- # Specs using numbers
- it "throws an argument error for a single digit" do
- lambda{ DateTime.parse("1") }.should raise_error(ArgumentError)
- end
-
- it "parses DD as month day number" do
- d = DateTime.parse("10")
- d.should == DateTime.civil(Date.today.year, Date.today.month, 10)
- end
-
- it "parses DDD as year day number" do
- d = DateTime.parse("100")
- if DateTime.gregorian_leap?(Date.today.year)
- d.should == DateTime.civil(Date.today.year, 4, 9)
- else
- d.should == DateTime.civil(Date.today.year, 4, 10)
- end
- end
-
- it "parses MMDD as month and day" do
- d = DateTime.parse("1108")
- d.should == DateTime.civil(Date.today.year, 11, 8)
- end
-
- it "parses YYYYMMDD as year, month and day" do
- d = DateTime.parse("20121108")
- d.should == DateTime.civil(2012, 11, 8)
- end
-
- describe "YYYY-MM-DDTHH:MM:SS format" do
- it "parses YYYY-MM-DDTHH:MM:SS into a DateTime object" do
- d = DateTime.parse("2012-11-08T15:43:59")
- d.should == DateTime.civil(2012, 11, 8, 15, 43, 59)
- end
-
- it "throws an argument error for invalid month values" do
- lambda{DateTime.parse("2012-13-08T15:43:59")}.should raise_error(ArgumentError)
- end
-
- it "throws an argument error for invalid day values" do
- lambda{DateTime.parse("2012-12-32T15:43:59")}.should raise_error(ArgumentError)
- end
-
- it "throws an argument error for invalid hour values" do
- lambda{DateTime.parse("2012-12-31T25:43:59")}.should raise_error(ArgumentError)
- end
-
- it "throws an argument error for invalid minute values" do
- lambda{DateTime.parse("2012-12-31T25:43:59")}.should raise_error(ArgumentError)
- end
-
- it "throws an argument error for invalid second values" do
- lambda{DateTime.parse("2012-11-08T15:43:61")}.should raise_error(ArgumentError)
- end
-
- end
-
- it "parses YYDDD as year and day number in 1969--2068" do
- d = DateTime.parse("10100")
- d.should == DateTime.civil(2010, 4, 10)
- end
-
- it "parses YYMMDD as year, month and day in 1969--2068" do
- d = DateTime.parse("201023")
- d.should == DateTime.civil(2020, 10, 23)
- end
-
- it "parses YYYYDDD as year and day number" do
- d = DateTime.parse("1910100")
- d.should == DateTime.civil(1910, 4, 10)
- end
-
- it "parses YYYYMMDD as year, month and day number" do
- d = DateTime.parse("19101101")
- d.should == DateTime.civil(1910, 11, 1)
- end
-end
-
-describe "DateTime.parse(.)" do
- it "parses YYYY.MM.DD into a DateTime object" do
- d = DateTime.parse("2007.10.01")
- d.year.should == 2007
- d.month.should == 10
- d.day.should == 1
- end
-
- it "parses DD.MM.YYYY into a DateTime object" do
- d = DateTime.parse("10.01.2007")
- d.year.should == 2007
- d.month.should == 1
- d.day.should == 10
- end
-
- it "parses YY.MM.DD into a DateTime object using the year 20YY" do
- d = DateTime.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 = DateTime.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/datetime/rfc2822_spec.rb b/spec/rubyspec/library/datetime/rfc2822_spec.rb
deleted file mode 100644
index 3fc4dc14b8..0000000000
--- a/spec/rubyspec/library/datetime/rfc2822_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime.rfc2822" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/rfc3339_spec.rb b/spec/rubyspec/library/datetime/rfc3339_spec.rb
deleted file mode 100644
index 4fea795d9e..0000000000
--- a/spec/rubyspec/library/datetime/rfc3339_spec.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime.rfc3339" do
- it "needs to be reviewed for spec completeness"
-end
-
-describe "DateTime#rfc3339" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/rfc822_spec.rb b/spec/rubyspec/library/datetime/rfc822_spec.rb
deleted file mode 100644
index f86ee77379..0000000000
--- a/spec/rubyspec/library/datetime/rfc822_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime.rfc822" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/sec_fraction_spec.rb b/spec/rubyspec/library/datetime/sec_fraction_spec.rb
deleted file mode 100644
index 3ed274a5bc..0000000000
--- a/spec/rubyspec/library/datetime/sec_fraction_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime#sec_fraction" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/sec_spec.rb b/spec/rubyspec/library/datetime/sec_spec.rb
deleted file mode 100644
index c7e9af2650..0000000000
--- a/spec/rubyspec/library/datetime/sec_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/sec', __FILE__)
-
-describe "DateTime.sec" do
- it_behaves_like :datetime_sec, :sec
-end
diff --git a/spec/rubyspec/library/datetime/second_fraction_spec.rb b/spec/rubyspec/library/datetime/second_fraction_spec.rb
deleted file mode 100644
index 32dc9333f6..0000000000
--- a/spec/rubyspec/library/datetime/second_fraction_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime#second_fraction" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/second_spec.rb b/spec/rubyspec/library/datetime/second_spec.rb
deleted file mode 100644
index 08cdf463f7..0000000000
--- a/spec/rubyspec/library/datetime/second_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../shared/sec', __FILE__)
-
-describe "DateTime#second" do
- it_behaves_like :datetime_sec, :second
-end
diff --git a/spec/rubyspec/library/datetime/shared/min.rb b/spec/rubyspec/library/datetime/shared/min.rb
deleted file mode 100644
index e69d86ab02..0000000000
--- a/spec/rubyspec/library/datetime/shared/min.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-require 'date'
-
-describe :datetime_min, shared: true do
- it "returns 0 if no argument is passed" do
- DateTime.new.send(@method).should == 0
- end
-
- it "returns the minute passed as argument" do
- new_datetime(minute: 5).send(@method).should == 5
- end
-
- it "adds 60 to negative minutes" do
- new_datetime(minute: -20).send(@method).should == 40
- end
-
- it "raises an error for Rational" do
- lambda { new_datetime minute: 5 + Rational(1,2) }.should raise_error(ArgumentError)
- end
-
- it "raises an error for Float" do
- lambda { new_datetime minute: 5.5 }.should raise_error(ArgumentError)
- end
-
- it "raises an error for Rational" do
- lambda { new_datetime(hour: 2 + Rational(1,2)) }.should raise_error(ArgumentError)
- end
-
- it "raises an error, when the minute is smaller than -60" do
- lambda { new_datetime(minute: -61) }.should raise_error(ArgumentError)
- end
-
- it "raises an error, when the minute is greater or equal than 60" do
- lambda { new_datetime(minute: 60) }.should raise_error(ArgumentError)
- end
-
- it "raises an error for minute fractions smaller than -60" do
- lambda { new_datetime(minute: -60 - Rational(1,2))}.should(
- raise_error(ArgumentError))
- end
-end
diff --git a/spec/rubyspec/library/datetime/shared/sec.rb b/spec/rubyspec/library/datetime/shared/sec.rb
deleted file mode 100644
index 68e8af8e40..0000000000
--- a/spec/rubyspec/library/datetime/shared/sec.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-require 'date'
-
-describe :datetime_sec, shared: true do
- it "returns 0 seconds if passed no arguments" do
- d = DateTime.new
- d.send(@method).should == 0
- end
-
- it "returns the seconds passed in the arguments" do
- new_datetime(second: 5).send(@method).should == 5
- end
-
- it "adds 60 to negative values" do
- new_datetime(second: -20).send(@method).should == 40
- end
-
- it "returns the absolute value of a Rational" do
- new_datetime(second: 5 + Rational(1,2)).send(@method).should == 5
- end
-
- it "returns the absolute value of a float" do
- new_datetime(second: 5.5).send(@method).should == 5
- end
-
- it "raises an error when minute is given as a rational" do
- lambda { new_datetime(minute: 5 + Rational(1,2)) }.should raise_error(ArgumentError)
- end
-
- it "raises an error, when the second is smaller than -60" do
- lambda { new_datetime(second: -61) }.should raise_error(ArgumentError)
- end
-
- it "raises an error, when the second is greater or equal than 60" do
- lambda { new_datetime(second: 60) }.should raise_error(ArgumentError)
- end
-
- it "raises an error for second fractions smaller than -60" do
- lambda { new_datetime(second: -60 - Rational(1,2))}.should(
- raise_error(ArgumentError))
- end
-
- it "takes a second fraction near 60" do
- new_datetime(second: 59 + Rational(1,2)).send(@method).should == 59
- end
-end
diff --git a/spec/rubyspec/library/datetime/strftime_spec.rb b/spec/rubyspec/library/datetime/strftime_spec.rb
deleted file mode 100644
index 37705788a1..0000000000
--- a/spec/rubyspec/library/datetime/strftime_spec.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-require 'date'
-require File.expand_path('../../../shared/time/strftime_for_date', __FILE__)
-require File.expand_path('../../../shared/time/strftime_for_time', __FILE__)
-
-describe "DateTime#strftime" do
- before :all do
- @new_date = lambda { |y,m,d| DateTime.civil(y,m,d) }
- @new_time = lambda { |*args| DateTime.civil(*args) }
- @new_time_in_zone = lambda { |zone,offset,*args|
- y, m, d, h, min, s = args
- DateTime.new(y, m||1, d||1, h||0, min||0, s||0, Rational(offset, 24))
- }
- @new_time_with_offset = lambda { |y,m,d,h,min,s,offset|
- DateTime.new(y,m,d,h,min,s, Rational(offset, 86_400))
- }
-
- @time = DateTime.civil(2001, 2, 3, 4, 5, 6)
- end
-
- it_behaves_like :strftime_date, :strftime
- it_behaves_like :strftime_time, :strftime
-
- # Differences with Time
- it "should be able to print the datetime with no argument" do
- @time.strftime.should == "2001-02-03T04:05:06+00:00"
- @time.strftime.should == @time.to_s
- end
-
- # %Z is %:z for Date/DateTime
- it "should be able to show the timezone with a : separator" do
- @time.strftime("%Z").should == "+00:00"
- end
-
- # %v is %e-%b-%Y for Date/DateTime
- it "should be able to show the commercial week" do
- @time.strftime("%v").should == " 3-Feb-2001"
- @time.strftime("%v").should == @time.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, 0, 0, 0).strftime("%Q").should == "0"
- @time.strftime("%Q").should == "981173106000"
- DateTime.civil(2001, 2, 3, 4, 5, Rational(6123, 1000)).strftime("%Q").should == "981173106123"
- end
-
- it "should be able to show a full notation" do
- @time.strftime("%+").should == "Sat Feb 3 04:05:06 +00:00 2001"
- @time.strftime("%+").should == @time.strftime('%a %b %e %H:%M:%S %Z %Y')
- end
-end
diff --git a/spec/rubyspec/library/datetime/strptime_spec.rb b/spec/rubyspec/library/datetime/strptime_spec.rb
deleted file mode 100644
index f3098f6f6b..0000000000
--- a/spec/rubyspec/library/datetime/strptime_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime.strptime" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/to_date_spec.rb b/spec/rubyspec/library/datetime/to_date_spec.rb
deleted file mode 100644
index 915e1ac87a..0000000000
--- a/spec/rubyspec/library/datetime/to_date_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime#to_date" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/to_datetime_spec.rb b/spec/rubyspec/library/datetime/to_datetime_spec.rb
deleted file mode 100644
index e289f8ce36..0000000000
--- a/spec/rubyspec/library/datetime/to_datetime_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime#to_datetime" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/to_s_spec.rb b/spec/rubyspec/library/datetime/to_s_spec.rb
deleted file mode 100644
index 893cc93283..0000000000
--- a/spec/rubyspec/library/datetime/to_s_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime#to_s" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/to_time_spec.rb b/spec/rubyspec/library/datetime/to_time_spec.rb
deleted file mode 100644
index aa2902930c..0000000000
--- a/spec/rubyspec/library/datetime/to_time_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime#to_time" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/xmlschema_spec.rb b/spec/rubyspec/library/datetime/xmlschema_spec.rb
deleted file mode 100644
index 5f33d33436..0000000000
--- a/spec/rubyspec/library/datetime/xmlschema_spec.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime.xmlschema" do
- it "needs to be reviewed for spec completeness"
-end
-
-describe "DateTime#xmlschema" do
- it "needs to be reviewed for spec completeness"
-end
diff --git a/spec/rubyspec/library/datetime/zone_spec.rb b/spec/rubyspec/library/datetime/zone_spec.rb
deleted file mode 100644
index fa8c9a982d..0000000000
--- a/spec/rubyspec/library/datetime/zone_spec.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require 'date'
-
-describe "DateTime#zone" do
- it "needs to be reviewed for spec completeness"
-end