diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-11 04:35:13 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-11 04:35:13 +0000 |
commit | b572705486175f551e1dd0568825f738198d4c52 (patch) | |
tree | 969e98246352767ea63c8668c5e576d099cf0669 /test | |
parent | 73400c01f76a312c01e6911059571143ce61d2d0 (diff) |
date_core.c: moved some methods to DateTime
* ext/date/date_core.c (Init_date_core): moved methods which make
sense only for DateTime to that class, instead of defining
private methods in Date and making them public in DateTime.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/date/test_switch_hitter.rb | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/test/date/test_switch_hitter.rb b/test/date/test_switch_hitter.rb index 16814d44df..4693cbd466 100644 --- a/test/date/test_switch_hitter.rb +++ b/test/date/test_switch_hitter.rb @@ -187,18 +187,18 @@ class TestSH < Test::Unit::TestCase d = Date.jd(Rational(2451944)) assert_equal(2451944, d.jd) d = Date.jd(2451944.5) - assert_equal([2451944, 12], [d.jd, d.send('hour')]) + assert_equal(2451944, d.jd) d = Date.jd(Rational('2451944.5')) - assert_equal([2451944, 12], [d.jd, d.send('hour')]) + assert_equal(2451944, d.jd) d = Date.civil(2001, 2, 3.0) assert_equal([2001, 2, 3], [d.year, d.mon, d.mday]) d = Date.civil(2001, 2, Rational(3)) assert_equal([2001, 2, 3], [d.year, d.mon, d.mday]) d = Date.civil(2001, 2, 3.5) - assert_equal([2001, 2, 3, 12], [d.year, d.mon, d.mday, d.send('hour')]) + assert_equal([2001, 2, 3], [d.year, d.mon, d.mday]) d = Date.civil(2001, 2, Rational('3.5')) - assert_equal([2001, 2, 3, 12], [d.year, d.mon, d.mday, d.send('hour')]) + assert_equal([2001, 2, 3], [d.year, d.mon, d.mday]) d = Date.ordinal(2001, 2.0) assert_equal([2001, 2], [d.year, d.yday]) @@ -266,10 +266,8 @@ class TestSH < Test::Unit::TestCase end def test_zone - d = Date.new(2001, 2, 3) - assert_equal(Encoding::US_ASCII, d.send(:zone).encoding) d = DateTime.new(2001, 2, 3) - assert_equal(Encoding::US_ASCII, d.send(:zone).encoding) + assert_equal(Encoding::US_ASCII, d.zone.encoding) end def test_to_s @@ -534,7 +532,6 @@ class TestSH < Test::Unit::TestCase s = "\x04\x03u:\x01\x04Date\x01\v\x04\x03[\x01\x02i\x03\xE8i%T" d = Marshal.load(s) assert_equal(Rational(4903887,2), d.ajd) - assert_equal(0, d.send(:offset)) assert_equal(Date::GREGORIAN, d.start) end @@ -542,7 +539,6 @@ class TestSH < Test::Unit::TestCase s = "\x04\x06u:\tDate\x0F\x04\x06[\ai\x03\xE8i%T" d = Marshal.load(s) assert_equal(Rational(4903887,2), d.ajd) - assert_equal(0, d.send(:offset)) assert_equal(Date::GREGORIAN, d.start) end @@ -550,7 +546,6 @@ class TestSH < Test::Unit::TestCase s = "\x04\bu:\tDateP\x04\b[\bo:\rRational\a:\x0F@numeratori\x03\xCF\xD3J:\x11@denominatori\ai\x00o:\x13Date::Infinity\x06:\a@di\xFA" d = Marshal.load(s) assert_equal(Rational(4903887,2), d.ajd) - assert_equal(0, d.send(:offset)) assert_equal(Date::GREGORIAN, d.start) s = "\x04\bu:\rDateTime`\x04\b[\bo:\rRational\a:\x0F@numeratorl+\b\xC9\xB0\x81\xBD\x02\x00:\x11@denominatori\x02\xC0\x12o;\x00\a;\x06i\b;\ai\ro:\x13Date::Infinity\x06:\a@di\xFA" @@ -564,7 +559,6 @@ class TestSH < Test::Unit::TestCase s = "\x04\bU:\tDate[\bU:\rRational[\ai\x03\xCF\xD3Ji\ai\x00o:\x13Date::Infinity\x06:\a@di\xFA" d = Marshal.load(s) assert_equal(Rational(4903887,2), d.ajd) - assert_equal(Rational(0,24), d.send(:offset)) assert_equal(Date::GREGORIAN, d.start) s = "\x04\bU:\rDateTime[\bU:\rRational[\al+\b\xC9\xB0\x81\xBD\x02\x00i\x02\xC0\x12U;\x06[\ai\bi\ro:\x13Date::Infinity\x06:\a@di\xFA" |