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