From 9fec000a296bd17d6bff048fc7034d566bb31484 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Sat, 13 Apr 2013 13:27:09 +0900 Subject: [PATCH] Slightly fix the timestamp tests. --- test/test_http_cookie_jar.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/test_http_cookie_jar.rb b/test/test_http_cookie_jar.rb index 9cd5c07..c909817 100644 --- a/test/test_http_cookie_jar.rb +++ b/test/test_http_cookie_jar.rb @@ -577,13 +577,15 @@ module TestHTTPCookieJar orig = HTTP::Cookie.new(cookie_values) @jar.add(orig) - time = Time.now + time = orig.accessed_at - assert_send [time, :>, orig.accessed_at], "accessed_at is initialized to the current time" + assert_in_delta 1.0, time, Time.now, "accessed_at is initialized to the current time" cookie, = @jar.to_a - assert_send [time, :>, cookie.accessed_at], "accessed_at is not updated by each()" + assert_equal time, cookie.accessed_at, "accessed_at is not updated by each()" + + sleep 0.1 cookie, = @jar.cookies("http://rubyforge.org/")