diff --git a/lib/webrat.rb b/lib/webrat.rb index 23e8f201..5cb47698 100644 --- a/lib/webrat.rb +++ b/lib/webrat.rb @@ -3,6 +3,7 @@ $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__))) unless $LOAD_PATH.include?(File.expand_path(File.dirname(__FILE__))) module Webrat + # The common base class for all exceptions raised by Webrat. class WebratError < StandardError end diff --git a/lib/webrat/core/configuration.rb b/lib/webrat/core/configuration.rb index 5adad902..13eb195a 100755 --- a/lib/webrat/core/configuration.rb +++ b/lib/webrat/core/configuration.rb @@ -12,14 +12,16 @@ def self.configuration end class Configuration + # Should XHTML be parsed with Nokogiri? Defaults to true, except on JRuby. When false, Hpricot and REXML are used attr_writer :parse_with_nokogiri + # Webrat's mode, set automatically when requiring webrat/rails, webrat/merb, etc. attr_accessor :mode - # Sets whether to save and open pages with error status codes in a browser + # Save and open pages with error status codes (500-599) in a browser? Defualts to true. attr_writer :open_error_files - def initialize + def initialize # :nodoc: self.open_error_files = true self.parse_with_nokogiri = !Webrat.on_java? end diff --git a/lib/webrat/core/field.rb b/lib/webrat/core/field.rb index 332cc3d5..75c0d96b 100644 --- a/lib/webrat/core/field.rb +++ b/lib/webrat/core/field.rb @@ -3,6 +3,7 @@ require "webrat/core_extensions/nil_to_param" module Webrat + # Raised when Webrat is asked to manipulate a disabled form field class DisabledFieldError < WebratError end diff --git a/lib/webrat/core/matchers/have_tag.rb b/lib/webrat/core/matchers/have_tag.rb index 01a2017a..eb3b0228 100644 --- a/lib/webrat/core/matchers/have_tag.rb +++ b/lib/webrat/core/matchers/have_tag.rb @@ -3,7 +3,6 @@ module Webrat module HaveTagMatcher class HaveTag < ::Webrat::Matchers::HaveSelector #:nodoc: - # ==== Returns # String:: The failure message. def failure_message @@ -46,12 +45,12 @@ def query Nokogiri::CSS::Parser.parse(selector).map { |ast| ast.to_xpath } end - end def have_tag(name, attributes = {}, &block) HaveTag.new([name, attributes], &block) end + alias_method :match_tag, :have_tag end diff --git a/lib/webrat/core/scope.rb b/lib/webrat/core/scope.rb index 9bc7ee89..1f477020 100644 --- a/lib/webrat/core/scope.rb +++ b/lib/webrat/core/scope.rb @@ -3,6 +3,7 @@ require "webrat/core_extensions/deprecate" module Webrat + # An HTML element (link, button, field, etc.) that Webrat expected was not found on the page class NotFoundError < WebratError end @@ -238,9 +239,7 @@ def click_area(area_name) # # Example: # click_link "Sign up" - # # click_link "Sign up", :javascript => false - # # click_link "Sign up", :method => :put def click_link(text_or_title_or_id, options = {}) find_link(text_or_title_or_id).click(options) diff --git a/lib/webrat/core/session.rb b/lib/webrat/core/session.rb index 634995bc..33e00fb2 100644 --- a/lib/webrat/core/session.rb +++ b/lib/webrat/core/session.rb @@ -4,6 +4,7 @@ require "webrat/core/mime" module Webrat + # A page load or form submission returned an unsuccessful response code (500-599) class PageLoadError < WebratError end @@ -132,9 +133,6 @@ def current_scope #:nodoc: # Reloads the last page requested. Note that this will resubmit forms # and their data. - # - # Example: - # reloads def reloads request_page(@current_url, @http_method, @data) end