webrat, mechanize and http proxies

17 views
Skip to first unread message

Chris Lowis

unread,
Aug 3, 2010, 7:13:49 AM8/3/10
to webrat
In a previous version of Webrat (I'm now using 0.7.1), using Webrat
with Cucumber, I used to be able to set the HTTP Proxy that mechanize
uses like so:
webrat.adaptor.mechanize.set_proxy(nil, nil)

Now I get
NoMethodError Exception: undefined method `adaptor' for
#<Webrat::Session:0x1a4c940>

Has the interface changed? I can still see an accessor for @adaptor in
http://github.com/brynary/webrat/blob/master/lib/webrat/core/session.rb

but for some reason, this doesn't work anymore. Any ideas?

Cheers,

Chris

tenstates

unread,
Aug 3, 2010, 11:18:12 PM8/3/10
to webrat
running the same version, but below is untested, using MerbAdapter to
Rack but would this do it? had an look at:
http://github.com/tenderlove/mechanize/blob/master/examples/proxy_req.rb.

agent = Webrat::MechanizeAdapter.new
agent.set_proxy('localhost', '8000')

session = Webrat::Session.new( agent )
Reply all
Reply to author
Forward
0 new messages