summaryrefslogtreecommitdiff
path: root/test/date
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-29 11:53:59 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-29 11:53:59 +0000
commit9d2f9f26e8c334f679e31ea5a598f863ac030b39 (patch)
treef043cfe0a9d1583f81f332a9a776d9171a02d13a /test/date
parent1ac57f70e8f5a7f4f333792e03aca06894d53195 (diff)
fixed previous commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/date')
-rw-r--r--test/date/test_date_new.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/date/test_date_new.rb b/test/date/test_date_new.rb
index 6c1e463..14ff247 100644
--- a/test/date/test_date_new.rb
+++ b/test/date/test_date_new.rb
@@ -255,11 +255,12 @@ class TestDateNew < Test::Unit::TestCase
end
def test_today
+ z = Time.now
d = Date.today
t = Time.now
t2 = Time.utc(t.year, t.mon, t.mday)
t3 = Time.utc(d.year, d.mon, d.mday)
- assert_in_delta(t2, t3, 10)
+ assert_in_delta(t2, t3, t - z + 2)
assert_equal(false, DateTime.respond_to?(:today))
end
@@ -267,10 +268,11 @@ class TestDateNew < Test::Unit::TestCase
def test_now
assert_equal(false, Date.respond_to?(:now))
+ z = Time.now
d = DateTime.now
t = Time.now
t2 = Time.local(d.year, d.mon, d.mday, d.hour, d.min, d.sec)
- assert_in_delta(t, t2, 10)
+ assert_in_delta(t, t2, t - z + 2)
end
end