Use assert_send for comparison tests to see what is going on.

This commit is contained in:
Akinori MUSHA 2013-04-12 23:18:06 +09:00
parent e1857d76a4
commit 75267e8002
2 changed files with 6 additions and 6 deletions

View file

@ -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

View file

@ -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|