This commit is contained in:
Bryan Helmkamp 2008-11-30 20:09:41 -05:00
parent 52aa8e2bba
commit f5ed57e042
15 changed files with 27 additions and 17 deletions

View File

@ -75,8 +75,13 @@ task :install_gem => [:clean, :package] do
sh "sudo gem install --local #{gem}"
end
desc "Delete generated RDoc"
task :clobber_docs do
FileUtils.rm_rf("doc")
end
desc "Generate RDoc"
task :docs do
task :docs => :clobber_docs do
system "hanna --title 'Webrat #{Webrat::VERSION} API Documentation'"
end

View File

@ -7,16 +7,21 @@ module Webrat
@@configuration = configuration
end
def self.configuration
def self.configuration # :nodoc:
@@configuration ||= Webrat::Configuration.new
end
# Webrat can be configured using the Webrat.configure method. For example:
#
# Webrat.configure do |config|
# config.parse_with_nokogiri = false
# 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
attr_accessor :mode # :nodoc:
# Save and open pages with error status codes (500-599) in a browser? Defualts to true.
attr_writer :open_error_files

View File

@ -1,6 +1,6 @@
module Webrat
class Element
class Element # :nodoc:
def self.load_all(session, dom)
Webrat::XML.xpath_search(dom, xpath_search).map do |element|

View File

@ -3,7 +3,7 @@ require "webrat/core/locators/locator"
module Webrat
module Locators
class AreaLocator < Locator
class AreaLocator < Locator # :nodoc:
def locate
Area.load(@session, area_element)

View File

@ -3,7 +3,7 @@ require "webrat/core/locators/locator"
module Webrat
module Locators
class ButtonLocator < Locator
class ButtonLocator < Locator # :nodoc:
def locate
ButtonField.load(@session, button_element)

View File

@ -3,7 +3,7 @@ require "webrat/core/locators/locator"
module Webrat
module Locators
class FieldByIdLocator < Locator
class FieldByIdLocator < Locator # :nodoc:
def locate
Field.load(@session, field_element)

View File

@ -4,7 +4,7 @@ require "webrat/core/locators/locator"
module Webrat
module Locators
class FieldLabeledLocator < Locator
class FieldLabeledLocator < Locator # :nodoc:
def locate
matching_labels.any? && matching_labels.first.field

View File

@ -3,7 +3,7 @@ require "webrat/core/locators/locator"
module Webrat
module Locators
class FieldLocator < Locator
class FieldLocator < Locator # :nodoc:
def locate
FieldByIdLocator.new(@session, @dom, @value).locate ||

View File

@ -3,7 +3,7 @@ require "webrat/core/locators/locator"
module Webrat
module Locators
class FieldNamedLocator < Locator
class FieldNamedLocator < Locator # :nodoc:
def locate
Field.load(@session, field_element)

View File

@ -3,7 +3,7 @@ require "webrat/core/locators/locator"
module Webrat
module Locators
class FormLocator < Locator
class FormLocator < Locator # :nodoc:
def locate
Form.load(@session, form_element)

View File

@ -4,7 +4,7 @@ require "webrat/core/locators/locator"
module Webrat
module Locators
class LabelLocator < Locator
class LabelLocator < Locator # :nodoc:
def locate
Label.load(@session, label_element)

View File

@ -3,7 +3,7 @@ require "webrat/core/locators/locator"
module Webrat
module Locators
class LinkLocator < Locator
class LinkLocator < Locator # :nodoc:
def locate
Link.load(@session, link_element)

View File

@ -1,7 +1,7 @@
module Webrat
module Locators
class Locator
class Locator # :nodoc:
def initialize(session, dom, value, *field_types)
@session = session

View File

@ -4,7 +4,7 @@ require "webrat/core/locators/locator"
module Webrat
module Locators
class SelectOptionLocator < Locator
class SelectOptionLocator < Locator # :nodoc:
def initialize(session, dom, option_text, id_or_name_or_label)
@session = session

View File

@ -182,7 +182,7 @@ module Webrat
end
end
def rewrite_css_and_image_references(response_html) #:nodoc
def rewrite_css_and_image_references(response_html) # :nodoc:
return response_html unless doc_root
response_html.gsub(/"\/(stylesheets|images)/, doc_root + '/\1')
end