More minor RDoc tweaks
This commit is contained in:
parent
2eefcf5060
commit
e822535b6e
|
@ -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__)))
|
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__))) unless $LOAD_PATH.include?(File.expand_path(File.dirname(__FILE__)))
|
||||||
|
|
||||||
module Webrat
|
module Webrat
|
||||||
|
# The common base class for all exceptions raised by Webrat.
|
||||||
class WebratError < StandardError
|
class WebratError < StandardError
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -12,14 +12,16 @@ module Webrat
|
||||||
end
|
end
|
||||||
|
|
||||||
class Configuration
|
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
|
attr_writer :parse_with_nokogiri
|
||||||
|
|
||||||
|
# Webrat's mode, set automatically when requiring webrat/rails, webrat/merb, etc.
|
||||||
attr_accessor :mode
|
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
|
attr_writer :open_error_files
|
||||||
|
|
||||||
def initialize
|
def initialize # :nodoc:
|
||||||
self.open_error_files = true
|
self.open_error_files = true
|
||||||
self.parse_with_nokogiri = !Webrat.on_java?
|
self.parse_with_nokogiri = !Webrat.on_java?
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,6 +3,7 @@ require "webrat/core_extensions/blank"
|
||||||
require "webrat/core_extensions/nil_to_param"
|
require "webrat/core_extensions/nil_to_param"
|
||||||
|
|
||||||
module Webrat
|
module Webrat
|
||||||
|
# Raised when Webrat is asked to manipulate a disabled form field
|
||||||
class DisabledFieldError < WebratError
|
class DisabledFieldError < WebratError
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ module Webrat
|
||||||
module HaveTagMatcher
|
module HaveTagMatcher
|
||||||
|
|
||||||
class HaveTag < ::Webrat::Matchers::HaveSelector #:nodoc:
|
class HaveTag < ::Webrat::Matchers::HaveSelector #:nodoc:
|
||||||
|
|
||||||
# ==== Returns
|
# ==== Returns
|
||||||
# String:: The failure message.
|
# String:: The failure message.
|
||||||
def failure_message
|
def failure_message
|
||||||
|
@ -46,12 +45,12 @@ module Webrat
|
||||||
|
|
||||||
Nokogiri::CSS::Parser.parse(selector).map { |ast| ast.to_xpath }
|
Nokogiri::CSS::Parser.parse(selector).map { |ast| ast.to_xpath }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def have_tag(name, attributes = {}, &block)
|
def have_tag(name, attributes = {}, &block)
|
||||||
HaveTag.new([name, attributes], &block)
|
HaveTag.new([name, attributes], &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
alias_method :match_tag, :have_tag
|
alias_method :match_tag, :have_tag
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,6 +3,7 @@ require "webrat/core/locators"
|
||||||
require "webrat/core_extensions/deprecate"
|
require "webrat/core_extensions/deprecate"
|
||||||
|
|
||||||
module Webrat
|
module Webrat
|
||||||
|
# An HTML element (link, button, field, etc.) that Webrat expected was not found on the page
|
||||||
class NotFoundError < WebratError
|
class NotFoundError < WebratError
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -238,9 +239,7 @@ module Webrat
|
||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
# click_link "Sign up"
|
# click_link "Sign up"
|
||||||
#
|
|
||||||
# click_link "Sign up", :javascript => false
|
# click_link "Sign up", :javascript => false
|
||||||
#
|
|
||||||
# click_link "Sign up", :method => :put
|
# click_link "Sign up", :method => :put
|
||||||
def click_link(text_or_title_or_id, options = {})
|
def click_link(text_or_title_or_id, options = {})
|
||||||
find_link(text_or_title_or_id).click(options)
|
find_link(text_or_title_or_id).click(options)
|
||||||
|
|
|
@ -4,6 +4,7 @@ require "ostruct"
|
||||||
require "webrat/core/mime"
|
require "webrat/core/mime"
|
||||||
|
|
||||||
module Webrat
|
module Webrat
|
||||||
|
# A page load or form submission returned an unsuccessful response code (500-599)
|
||||||
class PageLoadError < WebratError
|
class PageLoadError < WebratError
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -132,9 +133,6 @@ module Webrat
|
||||||
|
|
||||||
# Reloads the last page requested. Note that this will resubmit forms
|
# Reloads the last page requested. Note that this will resubmit forms
|
||||||
# and their data.
|
# and their data.
|
||||||
#
|
|
||||||
# Example:
|
|
||||||
# reloads
|
|
||||||
def reloads
|
def reloads
|
||||||
request_page(@current_url, @http_method, @data)
|
request_page(@current_url, @http_method, @data)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue