1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix imprecise duration addition test. Closes #8516 [Geoff Buesing]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6906 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jeremy Kemper 2007-05-30 07:21:14 +00:00
parent ff6d2aae0a
commit 962b12fb9f

View file

@ -48,10 +48,10 @@ class NumericExtTimeAndDateTimeTest < Test::Unit::TestCase
end
def test_duration_addition
assert_equal @now.advance(:days => 1, :months => 1), (1.day + 1.month).since(@now)
assert_equal @now.advance(:days => 1).advance(:months => 1), (1.day + 1.month).since(@now)
assert_equal @now.advance(:days => 7), (1.week + 5.seconds - 5.seconds).since(@now)
assert_equal @now.advance(:years => 2), (4.years - 2.years).since(@now)
assert_equal @dtnow.advance(:days => 1, :months => 1), (1.day + 1.month).since(@dtnow)
assert_equal @dtnow.advance(:days => 1).advance(:months => 1), (1.day + 1.month).since(@dtnow)
assert_equal @dtnow.advance(:days => 7), (1.week + 5.seconds - 5.seconds).since(@dtnow)
assert_equal @dtnow.advance(:years => 2), (4.years - 2.years).since(@dtnow)
end