summaryrefslogtreecommitdiffstats
path: root/spec/age_spec.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-08-04 21:16:12 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-08-04 21:16:12 +0200
commita317760054ac780d685f85228fe36eb87c6e0842 (patch)
tree9786944d6be877b7cb0dbd8ca7369a7c7eae8e4f /spec/age_spec.rb
parent1cd140288d68a1daf05e397df685d854b70bd7cd (diff)
downloadayk-a317760054ac780d685f85228fe36eb87c6e0842.zip
ayk-a317760054ac780d685f85228fe36eb87c6e0842.tar.gz
cleanup age_spec
Diffstat (limited to 'spec/age_spec.rb')
-rw-r--r--spec/age_spec.rb41
1 files changed, 18 insertions, 23 deletions
diff --git a/spec/age_spec.rb b/spec/age_spec.rb
index 23d54cb..045570c 100644
--- a/spec/age_spec.rb
+++ b/spec/age_spec.rb
@@ -56,11 +56,7 @@ describe DateTime do
r[1].should >= 0
r[1].should <= 11
r[2].should >= 0
- if r[2]>31
- puts @b
- puts at
- end
- r[2].should <= 31
+ r[2].should <= 30
x = (@b>>(12*r[0]+r[1]))+r[2]
x.year.should eql at.year
x.month.should eql at.month
@@ -69,27 +65,26 @@ describe DateTime do
end
it "should pass time computation" do
# change years
- full_check @b, DateTime.civil( 2010, 6, 27, 4, 40, 0), 0, 11, 0, 0, 0, 0
+ full_check @b, DateTime.civil( 2010, 7, 26, 4, 40, 0), 0, 11, 29, 0, 0, 0
full_check @b, DateTime.civil( 2010, 7, 27, 3, 40, 0), 0, 11, 29, 23, 0, 0
full_check @b, DateTime.civil( 2010, 7, 27, 4, 39, 0), 0, 11, 29, 23, 59, 0
full_check @b, DateTime.civil( 2010, 7, 27, 4, 39, 59), 0, 11, 29, 23, 59, 59
full_check @b, DateTime.civil( 2010, 7, 27, 4, 40, 0), 1, 0, 0, 0, 0, 0
- full_check @b, DateTime.civil( 2010, 9, 25, 3, 40, 0), 1, 1, 28, 23, 0, 0
- full_check @b, DateTime.civil( 2010, 9, 25, 4, 39, 0), 1, 1, 28, 23, 59, 0
- full_check @b, DateTime.civil( 2010, 9, 25, 4, 39, 59), 1, 1, 28, 23, 59, 59
- full_check @b, DateTime.civil( 2010, 9, 25, 4, 40, 0), 1, 1, 29, 0, 0, 0
- full_check @b, DateTime.civil( 2010, 9, 26, 3, 40, 0), 1, 1, 29, 23, 0, 0
- full_check @b, DateTime.civil( 2010, 9, 26, 4, 39, 0), 1, 1, 29, 23, 59, 0
- full_check @b, DateTime.civil( 2010, 9, 26, 4, 39, 59), 1, 1, 29, 23, 59, 59
- full_check @b, DateTime.civil( 2010, 9, 26, 4, 40, 0), 1, 1, 30, 0, 0, 0
- full_check @b, DateTime.civil( 2010, 9, 27, 3, 40, 0), 1, 1, 30, 23, 0, 0
- full_check @b, DateTime.civil( 2010, 9, 27, 4, 39, 0), 1, 1, 30, 23, 59, 0
- full_check @b, DateTime.civil( 2010, 9, 27, 4, 39, 59), 1, 1, 30, 23, 59, 59
- full_check @b, DateTime.civil( 2010, 9, 27, 4, 40, 0), 1, 2, 0, 0, 0, 0
- full_check @b, DateTime.civil( 2010, 9, 28, 3, 40, 0), 1, 2, 0, 23, 0, 0
- full_check @b, DateTime.civil( 2010, 9, 28, 4, 39, 0), 1, 2, 0, 23, 59, 0
- full_check @b, DateTime.civil( 2010, 9, 28, 4, 39, 59), 1, 2, 0, 23, 59, 59
- full_check @b, DateTime.civil( 2010, 9, 28, 4, 40, 0), 1, 2, 1, 0, 0, 0
- full_check @b, DateTime.civil( 2010, 9, 29, 3, 40, 0), 1, 2, 1, 23, 0, 0
+ full_check @b, DateTime.civil( 2010, 8, 25, 4, 40, 0), 1, 0, 29, 0, 0, 0
+ full_check @b, DateTime.civil( 2010, 8, 26, 3, 40, 0), 1, 0, 29, 23, 0, 0
+ full_check @b, DateTime.civil( 2010, 8, 26, 4, 39, 0), 1, 0, 29, 23, 59, 0
+ full_check @b, DateTime.civil( 2010, 8, 26, 4, 39, 59), 1, 0, 29, 23, 59, 59
+ full_check @b, DateTime.civil( 2010, 8, 26, 4, 40, 0), 1, 0, 30, 0, 0, 0
+ full_check @b, DateTime.civil( 2010, 8, 27, 3, 40, 0), 1, 0, 30, 23, 0, 0
+ full_check @b, DateTime.civil( 2010, 8, 27, 4, 39, 0), 1, 0, 30, 23, 59, 0
+ full_check @b, DateTime.civil( 2010, 8, 27, 4, 39, 59), 1, 0, 30, 23, 59, 59
+ full_check @b, DateTime.civil( 2010, 8, 27, 4, 40, 0), 1, 1, 0, 0, 0, 0
+ full_check @b, DateTime.civil( 2010, 8, 28, 3, 40, 0), 1, 1, 0, 23, 0, 0
+ full_check @b, DateTime.civil( 2010, 8, 28, 4, 39, 0), 1, 1, 0, 23, 59, 0
+ full_check @b, DateTime.civil( 2010, 8, 28, 4, 39, 59), 1, 1, 0, 23, 59, 59
+ full_check @b, DateTime.civil( 2010, 8, 28, 4, 40, 0), 1, 1, 1, 0, 0, 0
+ full_check @b, DateTime.civil( 2010, 8, 29, 3, 40, 0), 1, 1, 1, 23, 0, 0
+ full_check @b, DateTime.civil( 2010, 8, 29, 4, 39, 0), 1, 1, 1, 23, 59, 0
+ full_check @b, DateTime.civil( 2010, 8, 29, 4, 39, 59), 1, 1, 1, 23, 0, 59
end
end