date_ext 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/date_ext.gemspec +1 -1
- data/lib/quarter.rb +2 -2
- data/lib/year.rb +1 -1
- data/test/quarter_test.rb +7 -0
- data/test/year_test.rb +7 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
data/date_ext.gemspec
CHANGED
data/lib/quarter.rb
CHANGED
data/lib/year.rb
CHANGED
data/test/quarter_test.rb
CHANGED
@@ -26,4 +26,11 @@ class QuarterTest < Test::Unit::TestCase
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
+
context "#new" do
|
30
|
+
should "accept year and quarter as string" do
|
31
|
+
@quarter = Quarter.new("2009", "1")
|
32
|
+
assert_equal 2009, @quarter.year
|
33
|
+
assert_equal 1, @quarter.quarter
|
34
|
+
end
|
35
|
+
end
|
29
36
|
end
|
data/test/year_test.rb
CHANGED
@@ -39,6 +39,12 @@ class YearTest < Test::Unit::TestCase
|
|
39
39
|
should "have 2011-12-30 as last_weekday" do
|
40
40
|
assert_equal Date.new(2011,12,30), @year.last_weekday
|
41
41
|
end
|
42
|
-
|
43
42
|
end
|
43
|
+
|
44
|
+
context "#new" do
|
45
|
+
should "accept year and quarter as string" do
|
46
|
+
@year = Year.new("2009")
|
47
|
+
assert_equal 2009, @year.year
|
48
|
+
end
|
49
|
+
end
|
44
50
|
end
|