From 75267e8002eb1d81174d79b5814adc1a81785f59 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Fri, 12 Apr 2013 23:18:06 +0900 Subject: [PATCH] Use assert_send for comparison tests to see what is going on. --- test/test_http_cookie.rb | 2 +- test/test_http_cookie_jar.rb | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/test_http_cookie.rb b/test/test_http_cookie.rb index 80eb0da..d6a0a7c 100644 --- a/test/test_http_cookie.rb +++ b/test/test_http_cookie.rb @@ -50,7 +50,7 @@ class TestHTTPCookie < Test::Unit::TestCase silently do assert_equal 1, HTTP::Cookie.parse(cookie, url) { |c| assert c.expires, "Tried parsing: #{date}" - assert_equal(true, c.expires < yesterday) + assert_send [c.expires, :<, yesterday] }.size end end diff --git a/test/test_http_cookie_jar.rb b/test/test_http_cookie_jar.rb index ed3d64a..2e12633 100644 --- a/test/test_http_cookie_jar.rb +++ b/test/test_http_cookie_jar.rb @@ -582,15 +582,15 @@ module TestHTTPCookieJar time = Time.now - assert time > orig.accessed_at, "accessed_at is initialized to the current time" + assert_send [time, :>, orig.accessed_at], "accessed_at is initialized to the current time" cookie, = @jar.to_a - assert time > cookie.accessed_at, "accessed_at is not updated by each()" + assert_send [time, :>, cookie.accessed_at], "accessed_at is not updated by each()" cookie, = @jar.cookies("http://rubyforge.org/") - assert cookie.accessed_at > time, "accessed_at is not updated by each(url)" + assert_send [cookie.accessed_at, :>, time], "accessed_at is not updated by each(url)" end def test_max_cookies @@ -640,8 +640,8 @@ module TestHTTPCookieJar } } - assert_equal true, count > slimit - assert_equal true, @jar.to_a.size <= slimit + assert_send [count, :>, slimit] + assert_send [@jar.to_a.size, :<=, slimit] @jar.cleanup assert_equal hlimit, @jar.to_a.size assert_equal false, @jar.any? { |cookie|