From 8cd604c6c7bb27545bf7fcecf06cad673ab4131d Mon Sep 17 00:00:00 2001 From: tadf Date: Wed, 22 Feb 2012 10:23:23 +0000 Subject: [PATCH] * reverted 34739 for test/date. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ test/date/test_date_attr.rb | 3 ++- test/date/test_date_base.rb | 10 +++++++++- test/date/test_date_new.rb | 6 ++++-- test/date/test_switch_hitter.rb | 3 ++- 5 files changed, 21 insertions(+), 5 deletions(-) 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