From cbfdacdd36159981544edaf540aa1611e2cc6a3a Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 25 Dec 2009 12:38:16 +0000 Subject: [PATCH] add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_time.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index 42153c9a13..cf2d51c925 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -365,6 +365,10 @@ class TestTime < Test::Unit::TestCase assert_raise(TypeError) { t0 + nil } assert_raise(TypeError) { t0 + "1" } assert_raise(TypeError) { t0 + SimpleDelegator.new("1") } + assert_equal(0.5, (t0 + 1.5).subsec) + assert_equal(Rational(1,3), (t0 + Rational(4,3)).subsec) + assert_equal(0.5, (t0 + SimpleDelegator.new(1.5)).subsec) + assert_equal(Rational(1,3), (t0 + SimpleDelegator.new(Rational(4,3))).subsec) end def test_readers