Permalink
Browse files

Mechanize#cookie_jar= works again. #126

  • Loading branch information...
1 parent 2351e5e commit eb9e8dc377467bd516ae7912053dc7fe42f1a532 @drbrain drbrain committed Jul 8, 2011
Showing with 17 additions and 2 deletions.
  1. +5 −0 CHANGELOG.rdoc
  2. +1 −1 lib/mechanize.rb
  3. +1 −1 lib/mechanize/http/agent.rb
  4. +10 −0 test/test_mechanize.rb
View
5 CHANGELOG.rdoc
@@ -1,5 +1,10 @@
= Mechanize CHANGELOG
+=== 2.0.2 / ??
+
+* Bug fixes
+ * Mechanize#cookie_jar= works again. Issue #126
+
=== 2.0.1 / 2011-06-28
Mechanize now uses minitest to avoid 1.9 vs 1.8 assertion availability in
View
2 lib/mechanize.rb
@@ -33,7 +33,7 @@ class Mechanize
##
# The version of Mechanize you are using.
- VERSION = '2.0.1'
+ VERSION = '2.0.2'
class Error < RuntimeError
end
View
2 lib/mechanize/http/agent.rb
@@ -3,7 +3,7 @@
class Mechanize::HTTP::Agent
- attr_reader :cookie_jar
+ attr_accessor :cookie_jar
# Disables If-Modified-Since conditional requests (enabled by default)
attr_accessor :conditional_requests
View
10 test/test_mechanize.rb
@@ -172,6 +172,16 @@ def test_click_more
@mech.page.uri.to_s
end
+ def test_cookie_jar
+ assert_kind_of Mechanize::CookieJar, @mech.cookie_jar
+
+ jar = Mechanize::CookieJar.new
+
+ @mech.cookie_jar = jar
+
+ assert_equal jar, @mech.cookie_jar
+ end
+
def test_delete
page = @mech.delete('http://localhost/verb', { 'q' => 'foo' })
assert_equal 1, @mech.history.length

0 comments on commit eb9e8dc

Please sign in to comment.