Class: WWW::Mechanize
Defined Under Namespace
Classes: File
Class Method Summary collapse
Instance Method Summary collapse
-
#fetch_page_with_secret_sauce(params) ⇒ Object
(also: #fetch_page)
Mechanize throws exceptions for certain HTTP status codes.
Class Method Details
.log_disabled ⇒ Object
27 28 29 |
# File 'lib/cucumber/webrat/mechanize_world.rb', line 27 def self.log_disabled @@log ||= Logger.new(STDOUT) end |
Instance Method Details
#fetch_page_with_secret_sauce(params) ⇒ Object Also known as: fetch_page
Mechanize throws exceptions for certain HTTP status codes. We want to catch these and still create a page.
57 58 59 60 61 62 63 64 65 |
# File 'lib/cucumber/webrat/mechanize_world.rb', line 57 def fetch_page_with_secret_sauce(params) begin page = fetch_page_without_secret_sauce(params) rescue ResponseCodeError => e page = e.page end page.redirects ||= params[:redirects].to_i page end |