More minor RDoc tweaks

This commit is contained in:
Bryan Helmkamp 2008-11-25 01:34:34 -05:00
parent 2eefcf5060
commit e822535b6e
6 changed files with 9 additions and 9 deletions

View File

@ -3,6 +3,7 @@ require "rubygems"
$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

View File

@ -12,14 +12,16 @@ module Webrat
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

View File

@ -3,6 +3,7 @@ require "webrat/core_extensions/blank"
require "webrat/core_extensions/nil_to_param"
module Webrat
# Raised when Webrat is asked to manipulate a disabled form field
class DisabledFieldError < WebratError
end

View File

@ -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 @@ module Webrat
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

View File

@ -3,6 +3,7 @@ require "webrat/core/locators"
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 @@ module Webrat
#
# 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)

View File

@ -4,6 +4,7 @@ require "ostruct"
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 @@ module Webrat
# 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