diff --git a/ChangeLog b/ChangeLog index ee69ea97c5..d4621b0fb1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Feb 22 19:22:31 2012 Tadayoshi Funaba + + * reverted 34739 for test/date. + Wed Feb 22 19:08:55 2012 Tanaka Akira * ext/curses/extconf.rb: refactored. diff --git a/test/date/test_date_attr.rb b/test/date/test_date_attr.rb index 2f0246296d..88a54d7461 100644 --- a/test/date/test_date_attr.rb +++ b/test/date/test_date_attr.rb @@ -96,6 +96,7 @@ class TestDateAttr < Test::Unit::TestCase end def test_nth_kday + skip unless Date.new.respond_to?(:nth_kday?, true) assert_equal(false, Date.new(2001,1,14).__send__(:nth_kday?, 1,0)) assert_equal(true, Date.new(2001,1,14).__send__(:nth_kday?, 2,0)) assert_equal(false, Date.new(2001,1,14).__send__(:nth_kday?, 3,0)) @@ -106,6 +107,6 @@ class TestDateAttr < Test::Unit::TestCase assert_equal(true, Date.new(2001,1,14).__send__(:nth_kday?, -3,0)) assert_equal(false, Date.new(2001,1,14).__send__(:nth_kday?, -4,0)) assert_equal(false, Date.new(2001,1,14).__send__(:nth_kday?, -5,0)) - end if Date.new.respond_to?(:nth_kday?, true) + end end diff --git a/test/date/test_date_base.rb b/test/date/test_date_base.rb index 81be8907ea..1f3d8c0a55 100644 --- a/test/date/test_date_base.rb +++ b/test/date/test_date_base.rb @@ -53,6 +53,7 @@ class TestDateBase < Test::Unit::TestCase end def test_ordinal__julian + skip unless defined?(Calendar) for j in @from..@to m, d, y = julian_from_absolute(absolute_from_julian_day_number(j)) j0 = julian_day_number_from_absolute(absolute_from_julian(12, 31, y - 1)) @@ -67,6 +68,7 @@ class TestDateBase < Test::Unit::TestCase end def test_ordinal__gregorian + skip unless defined?(Calendar) for j in @from..@to m, d, y = gregorian_from_absolute(absolute_from_julian_day_number(j)) j0 = @@ -82,6 +84,7 @@ class TestDateBase < Test::Unit::TestCase end def test_civil__julian + skip unless defined?(Calendar) for j in @from..@to m, d, y = julian_from_absolute(absolute_from_julian_day_number(j)) j2 = julian_day_number_from_absolute(absolute_from_julian(m, d, y)) @@ -96,6 +99,7 @@ class TestDateBase < Test::Unit::TestCase end def test_civil__gregorian + skip unless defined?(Calendar) for j in @from..@to m, d, y = gregorian_from_absolute(absolute_from_julian_day_number(j)) j2 = julian_day_number_from_absolute(absolute_from_gregorian(m, d, y)) @@ -110,6 +114,7 @@ class TestDateBase < Test::Unit::TestCase end def test_commercial__gregorian + skip unless defined?(Calendar) for j in @from..@to w, d, y = iso_from_absolute(absolute_from_julian_day_number(j)) j2 = julian_day_number_from_absolute(absolute_from_iso(w, d, y)) @@ -124,6 +129,7 @@ class TestDateBase < Test::Unit::TestCase end def test_weeknum + skip unless defined?(Calendar) for j in @from..@to for k in 0..1 wy, ww, wd = Date.__send__(:jd_to_weeknum, j, k, Date::GREGORIAN) @@ -134,6 +140,7 @@ class TestDateBase < Test::Unit::TestCase end def test_weeknum__2 + skip unless defined?(Calendar) for j in @from4t..@to4t d = Date.jd(j) t = Time.mktime(d.year, d.mon, d.mday) @@ -151,6 +158,7 @@ class TestDateBase < Test::Unit::TestCase end def test_nth_kday + skip unless defined?(Calendar) skip unless (Date.respond_to?(:nth_kday_to_jd, true) && Date.respond_to?(:jd_to_nth_kday, true)) for y in 1601..2401 @@ -431,4 +439,4 @@ class TestDateBase < Test::Unit::TestCase assert_nil(DateTime.__send__(valid_time_p, 24,1,1)) end -end if defined?(Calendar) +end diff --git a/test/date/test_date_new.rb b/test/date/test_date_new.rb index c46cb4664b..0bbbfee44b 100644 --- a/test/date/test_date_new.rb +++ b/test/date/test_date_new.rb @@ -202,6 +202,7 @@ class TestDateNew < Test::Unit::TestCase end def test_weeknum + skip unless Date.respond_to?(:weeknum, true) d = Date.__send__(:weeknum) dt = DateTime.__send__(:weeknum) assert_equal([-4712, 1, 1], [d.year, d.mon, d.mday]) @@ -221,9 +222,10 @@ class TestDateNew < Test::Unit::TestCase assert_raise(ArgumentError) do Date.__send__(:weeknum, 1999,-53,-1, 0) end - end if Date.respond_to?(:weeknum, true) + end def test_nth_kday + skip unless Date.respond_to?(:nth_kday, true) d = Date.__send__(:nth_kday) dt = DateTime.__send__(:nth_kday) assert_equal([-4712, 1, 1], [d.year, d.mon, d.mday]) @@ -243,7 +245,7 @@ class TestDateNew < Test::Unit::TestCase assert_raise(ArgumentError) do Date.__send__(:nth_kday, 2006,5, -5,0) end - end if Date.respond_to?(:nth_kday, true) + end def test_today z = Time.now diff --git a/test/date/test_switch_hitter.rb b/test/date/test_switch_hitter.rb index 7206904175..8431d40a29 100644 --- a/test/date/test_switch_hitter.rb +++ b/test/date/test_switch_hitter.rb @@ -570,7 +570,8 @@ class TestSH < Test::Unit::TestCase end def test_base + skip unless defined?(Date.test_all) assert_equal(true, Date.test_all) - end if defined?(Date.test_all) + end end