lib/capybara/mechanize.rb in capybara-mechanize-0.2.7 vs lib/capybara/mechanize.rb in capybara-mechanize-0.3.0.rc1

- old
+ new

@@ -1,11 +1,24 @@ require 'capybara' -module Capybara - module Driver - autoload :Mechanize, 'capybara/driver/mechanize_driver' +module Capybara::Mechanize + class << self + + # Host that should be considered local (includes default_host) + def local_hosts + @local_hosts ||= begin + default_host = URI.parse(Capybara.default_host || "").host || Capybara.default_host + [default_host].compact + end + end + + def local_hosts=(hosts) + @local_hosts = hosts + end end end +require 'capybara/mechanize/driver' + Capybara.register_driver :mechanize do |app| - Capybara::Driver::Mechanize.new(app) + Capybara::Mechanize::Driver.new(app) end \ No newline at end of file