From aa64d3d98b52b8c2feda106a955bf4c95518503c Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Sun, 21 Oct 2012 23:48:57 +0900 Subject: [PATCH] Rename HTTP::Cookie#clear! to clear. --- lib/http/cookie_jar.rb | 2 +- test/test_http_cookie_jar.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/http/cookie_jar.rb b/lib/http/cookie_jar.rb index 3dba734..1195b36 100644 --- a/lib/http/cookie_jar.rb +++ b/lib/http/cookie_jar.rb @@ -156,7 +156,7 @@ class HTTP::CookieJar end # Clear the cookie jar - def clear! + def clear @jar = {} end diff --git a/test/test_http_cookie_jar.rb b/test/test_http_cookie_jar.rb index b447d01..44088eb 100644 --- a/test/test_http_cookie_jar.rb +++ b/test/test_http_cookie_jar.rb @@ -254,7 +254,7 @@ class TestHTTPCookieJar < Test::Unit::TestCase assert_equal(0, @jar.cookies(url).length) end - def test_clear_bang + def test_clear url = URI 'http://rubyforge.org/' # Add one cookie with an expiration date in the future @@ -263,7 +263,7 @@ class TestHTTPCookieJar < Test::Unit::TestCase @jar.add(url, HTTP::Cookie.new(cookie_values(:name => 'Baz'))) assert_equal(2, @jar.cookies(url).length) - @jar.clear! + @jar.clear assert_equal(0, @jar.cookies(url).length) end @@ -448,7 +448,7 @@ class TestHTTPCookieJar < Test::Unit::TestCase in_tmpdir do @jar.save_as("cookies.txt", :cookiestxt) - @jar.clear! + @jar.clear @jar.load("cookies.txt", :cookiestxt) end @@ -463,7 +463,7 @@ class TestHTTPCookieJar < Test::Unit::TestCase in_tmpdir do @jar.save_as("cookies.txt", :cookiestxt) - @jar.clear! + @jar.clear @jar.load("cookies.txt", :cookiestxt) end