Skip to content

Commit

Permalink
RDoc tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
brynary committed Nov 25, 2008
1 parent 5502948 commit 3b8fc55
Show file tree
Hide file tree
Showing 17 changed files with 51 additions and 226 deletions.
33 changes: 16 additions & 17 deletions README.txt → README.rdoc
@@ -1,12 +1,11 @@
=== Webrat
= Webrat - Ruby Acceptance Testing for Web applications

- [Code on GitHub](http://github.com/brynary/webrat)
- [Tickets on Lighthouse](http://webrat.lighthouseapp.com/)
- {Code on GitHub}[http://github.com/brynary/webrat]
- {Tickets on Lighthouse}[http://webrat.lighthouseapp.com/]

=== Description
== Description

Webrat (_Ruby Acceptance Testing for Web applications_)
lets you quickly write robust and thorough acceptance tests for a Ruby
Webrat lets you quickly write robust and thorough acceptance tests for a Ruby
web application. By leveraging the DOM, it can run tests similarly to an
in-browser testing solution without the associated performance hit (and
browser dependency). The result is tests that are less fragile and more
Expand All @@ -19,9 +18,9 @@ that may make it a requirement for your project. If JavaScript is not central
to your application, Webrat is a simpler, effective solution that will let you
run your tests much faster and more frequently.

Initial development was sponsored by [EastMedia](http://www.eastmedia.com).
Initial development was sponsored by EastMedia[http://www.eastmedia.com].

=== Synopsis
== Synopsis

def test_sign_up
visit "/"
Expand Down Expand Up @@ -59,14 +58,14 @@ tests to break unnecessarily as your application evolves:

A test written with Webrat can handle these changes to these without any modifications.

=== Merb
== Merb
To avoid losing sessions, you need this in environments/test.rb:

Merb::Config.use do |c|
c[:session_store] = 'memory'
end
Merb::Config.use do |c|
c[:session_store] = 'memory'
end

=== Install
== Install

To install the latest release:

Expand All @@ -78,13 +77,13 @@ In your stories/helper.rb:

You could also unpack the gem into vendor/plugins.

=== Authors
== Authors

- Maintained by [Bryan Helmkamp](mailto:bryan@brynary.com)
- Original code written by [Seth Fitzsimmons](mailto:seth@mojodna.net)
- Maintained by {Bryan Helmkamp}[mailto:bryan@brynary.com]
- Original code written by {Seth Fitzsimmons}[mailto:seth@mojodna.net]
- Many other contributors. See attributions in History.txt

=== License
== License

Copyright (c) 2007 Bryan Helmkamp, Seth Fitzsimmons.
See MIT-LICENSE.txt in this directory.
4 changes: 2 additions & 2 deletions lib/webrat/core/configuration.rb
Expand Up @@ -24,11 +24,11 @@ def initialize
self.parse_with_nokogiri = !Webrat.on_java?
end

def parse_with_nokogiri?
def parse_with_nokogiri? #:nodoc:
@parse_with_nokogiri ? true : false
end

def open_error_files?
def open_error_files? #:nodoc:
@open_error_files ? true : false
end

Expand Down
4 changes: 2 additions & 2 deletions lib/webrat/core/locators.rb
Expand Up @@ -11,7 +11,7 @@ def field_by_xpath(xpath)
end
end

def field(*args)
def field(*args) # :nodoc:
# This is the default locator strategy
find_field_with_id(*args) ||
find_field_named(*args) ||
Expand Down Expand Up @@ -96,7 +96,7 @@ def find_link(text_or_title_or_id) #:nodoc:
end
end

def find_field_id_for_label(label_text)
def find_field_id_for_label(label_text) #:nodoc:
label = forms.detect_mapped { |form| form.label_matching(label_text) }
if label
label.for_id
Expand Down
3 changes: 0 additions & 3 deletions lib/webrat/core/matchers/have_content.rb
Expand Up @@ -42,9 +42,6 @@ def content_message

# Matches the contents of an HTML document with
# whatever string is supplied
#
# ---
# @api public
def contain(content)
HasContent.new(content)
end
Expand Down
2 changes: 0 additions & 2 deletions lib/webrat/core/matchers/have_selector.rb
Expand Up @@ -28,8 +28,6 @@ def query
#
# ==== Returns
# HaveSelector:: A new have selector matcher.
# ---
# @api public
def have_selector(expected, &block)
HaveSelector.new(expected, &block)
end
Expand Down
2 changes: 0 additions & 2 deletions lib/webrat/core/matchers/have_xpath.rb
Expand Up @@ -74,8 +74,6 @@ def negative_failure_message
#
# ==== Returns
# HaveXpath:: A new have xpath matcher.
# ---
# @api public
def have_xpath(expected, &block)
HaveXpath.new(expected, &block)
end
Expand Down
6 changes: 3 additions & 3 deletions lib/webrat/core/mime.rb
@@ -1,7 +1,7 @@
module Webrat
module MIME
module Webrat #:nodoc:
module MIME #:nodoc:

def self.mime_type(string_or_symbol)
def self.mime_type(string_or_symbol) #:nodoc:
if string_or_symbol.is_a?(String)
string_or_symbol
else
Expand Down
6 changes: 3 additions & 3 deletions lib/webrat/core/nokogiri.rb
Expand Up @@ -27,9 +27,9 @@ def self.define_dom_method(object, dom) #:nodoc:
end


module Nokogiri
module CSS
class XPathVisitor
module Nokogiri #:nodoc:
module CSS #:nodoc:
class XPathVisitor #:nodoc:

def visit_pseudo_class_text(node) #:nodoc:
"@type='text'"
Expand Down
8 changes: 4 additions & 4 deletions lib/webrat/core/xml.rb
@@ -1,7 +1,7 @@
module Webrat
module XML
module Webrat #:nodoc:
module XML #:nodoc:

def self.document(stringlike)
def self.document(stringlike) #:nodoc:
if Webrat.configuration.parse_with_nokogiri?
Webrat.nokogiri_document(stringlike)
else
Expand All @@ -21,7 +21,7 @@ def self.document(stringlike)
end
end

def self.css_search(element, *searches)
def self.css_search(element, *searches) #:nodoc:
if Webrat.configuration.parse_with_nokogiri?
element.css(*searches)
else
Expand Down
4 changes: 2 additions & 2 deletions lib/webrat/mechanize.rb
@@ -1,7 +1,7 @@
require "mechanize"

module Webrat
class MechanizeSession < Session
module Webrat #:nodoc:
class MechanizeSession < Session #:nodoc:

attr_accessor :response
alias :page :response
Expand Down
4 changes: 2 additions & 2 deletions lib/webrat/merb.rb
Expand Up @@ -52,8 +52,8 @@ def follow_redirect
end
end

module Merb
module Test
module Merb #:nodoc:
module Test #:nodoc:
module RequestHelper #:nodoc:
def request(uri, env = {})
@_webrat_session ||= Webrat::MerbSession.new
Expand Down
4 changes: 2 additions & 2 deletions lib/webrat/rails.rb
Expand Up @@ -69,8 +69,8 @@ def response #:nodoc:
end
end

module ActionController
module Integration
module ActionController #:nodoc:
module Integration #:nodoc:
class Session #:nodoc:
unless instance_methods.include?("put_via_redirect")
require "webrat/rails/redirect_actions"
Expand Down
18 changes: 9 additions & 9 deletions lib/webrat/selenium.rb
Expand Up @@ -7,37 +7,37 @@

module Webrat

def self.with_selenium_server
def self.with_selenium_server #:nodoc:
start_selenium_server
yield
stop_selenium_server
end

def self.start_selenium_server
def self.start_selenium_server #:nodoc:
remote_control = ::Selenium::RemoteControl::RemoteControl.new("0.0.0.0", 4444, 5)
remote_control.jar_file = File.expand_path(__FILE__ + "../../../../vendor/selenium-server.jar")
remote_control.start :background => true
TCPSocket.wait_for_service :host => "0.0.0.0", :port => 4444
end

def self.stop_selenium_server
def self.stop_selenium_server #:nodoc:
remote_control = ::Selenium::RemoteControl::RemoteControl.new("0.0.0.0", 4444, 5)
remote_control.stop
end

def self.start_app_server
def self.start_app_server #:nodoc:
pid_file = File.expand_path(RAILS_ROOT + "/tmp/pids/mongrel_selenium.pid")
system("mongrel_rails start -d --chdir=#{RAILS_ROOT} --port=3001 --environment=selenium --pid #{pid_file} &")
TCPSocket.wait_for_service :host => "0.0.0.0", :port => 3001
end

def self.stop_app_server
def self.stop_app_server #:nodoc:
pid_file = File.expand_path(RAILS_ROOT + "/tmp/pids/mongrel_selenium.pid")
system "mongrel_rails stop -c #{RAILS_ROOT} --pid #{pid_file}"
end

module Selenium
module Rails
module Selenium #:nodoc:
module Rails #:nodoc:
class World < ::ActionController::IntegrationTest

def initialize #:nodoc:
Expand All @@ -50,8 +50,8 @@ def initialize #:nodoc:

end

module ::ActionController
module Integration
module ::ActionController #:nodoc:
module Integration #:nodoc:
class Session #:nodoc:
include Webrat::Methods
end
Expand Down
6 changes: 3 additions & 3 deletions lib/webrat/selenium/selenium_session.rb
Expand Up @@ -134,7 +134,7 @@ def browser

protected

def setup
def setup #:nodoc:
silence_stream(STDOUT) do
Webrat.start_selenium_server
Webrat.start_app_server
Expand All @@ -147,11 +147,11 @@ def setup
teardown_at_exit
end

def selenium
def selenium #:nodoc:
browser
end

def teardown_at_exit
def teardown_at_exit #:nodoc:
at_exit do
silence_stream(STDOUT) do
$browser.stop
Expand Down
40 changes: 0 additions & 40 deletions lib/webrat/test/run_spec.rb

This file was deleted.

0 comments on commit 3b8fc55

Please sign in to comment.