You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement cookie testing methods in Test::WWW::Mechanize
and have found myself replicating a bunch of code from
add_cookie_header() in my scan() callback. I propose that the cookie
matching code be factored out of add_cookie_header() into a separate
method. The attached patch implements such a refactoring by creating a
new method called cookie_matching() which accepts a $request and returns
an array of cookies. add_cookie_header() is thus reduced to just the
data munging steps. I've deliberately left whitespace alone to minimize
the size of the attached patch, but the code should be re-indented if
applied.
I see from
http://rt.cpan.org/Ticket/Display.html?id=12151
that you prefer not to implement a more detailed cookie inspection API,
and that you believe that web apps should employ functional tests
instead of unit tests with regard to cookies. So, I understand if you
reject this patch. However, I believe that unit tests on cookies do make
web testing code significantly simpler, and I've made my patch as
unintrusive as possible.
If this patch is acceptable, then I would be willing to document this
new method as well.
Thanks,
Chris
The text was updated successfully, but these errors were encountered:
Migrated from rt.cpan.org#23980 (status was 'new')
Requestors:
Attachments:
From [email protected] on 2006-12-18 17:27:18:
The text was updated successfully, but these errors were encountered: