Skip to content

Commit

Permalink
Fix method comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tricknotes committed Mar 29, 2013
1 parent 1232a91 commit 30d5ccc
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lib/capybara/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def to_regexp(text)
# `Capybara.asset_host`.
#
# @param [String] html HTML code to inject into
# @param [String] The modified HTML code
# @return [String] The modified HTML code
#
def inject_asset_host(html)
if Capybara.asset_host
Expand Down
12 changes: 6 additions & 6 deletions lib/capybara/node/actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def click_button(locator, options={})
#
# page.fill_in 'Name', :with => 'Bob'
#
# @param [String] locator Which field to fill in
# @param [Hash{:with => String}] The value to fill in
# @param [String] locator Which field to fill in
# @param [Hash{:with => String}] options The value to fill in
#
def fill_in(locator, options={})
raise "Must pass a hash containing 'with'" if not options.is_a?(Hash) or not options.has_key?(:with)
Expand Down Expand Up @@ -100,8 +100,8 @@ def uncheck(locator, options={})
#
# page.select 'March', :from => 'Month'
#
# @param [String] value Which option to select
# @param [Hash{:from => String}] The id, name or label of the select box
# @param [String] value Which option to select
# @param [Hash{:from => String}] options The id, name or label of the select box
#
def select(value, options={})
if options.has_key?(:from)
Expand All @@ -120,8 +120,8 @@ def select(value, options={})
#
# page.unselect 'March', :from => 'Month'
#
# @param [String] value Which option to unselect
# @param [Hash{:from => String}] The id, name or label of the select box
# @param [String] value Which option to unselect
# @param [Hash{:from => String}] options The id, name or label of the select box
#
def unselect(value, options={})
if options.has_key?(:from)
Expand Down
5 changes: 2 additions & 3 deletions lib/capybara/node/element.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ def native
# ignored. This behaviour can be overridden by passing `:all` to this
# method.
#
# @param [:all, :visible] Whether to return only visible or all text
#
# @return [String] The text of the element
# @param [:all, :visible] type Whether to return only visible or all text
# @return [String] The text of the element
#
def text(type=nil)
type ||= :all unless Capybara.ignore_hidden_elements or Capybara.visible_text_only
Expand Down
2 changes: 1 addition & 1 deletion lib/capybara/node/finders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def all(*args)
# @overload first([kind], locator, options)
# @param [:css, :xpath] kind The type of selector
# @param [String] locator The selector
# @param [Hash] options Additional options; see {all}
# @param [Hash] options Additional options; see {#all}
# @return [Capybara::Element] The found element or nil
#
def first(*args)
Expand Down
12 changes: 6 additions & 6 deletions lib/capybara/node/matchers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ module Matchers
# page.has_selector?(:xpath, XPath.descendant(:p))
#
# @param (see Capybara::Node::Finders#all)
# @param options a customizable set of options
# @option options [Integer] :count (nil) Number of times the text should occur
# @option options [Integer] :minimum (nil) Minimum number of times the text should occur
# @option options [Integer] :maximum (nil) Maximum number of times the text should occur
# @option options [Range] :between (nil) Range of times that should contain number of times text occurs
# @return [Boolean] If the expression exists
# @param args
# @option args [Integer] :count (nil) Number of times the text should occur
# @option args [Integer] :minimum (nil) Minimum number of times the text should occur
# @option args [Integer] :maximum (nil) Maximum number of times the text should occur
# @option args [Range] :between (nil) Range of times that should contain number of times text occurs
# @return [Boolean] If the expression exists
#
def has_selector?(*args)
assert_selector(*args)
Expand Down
4 changes: 2 additions & 2 deletions lib/capybara/node/simple.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def text(type=nil)
#
# element[:title] # => HTML title attribute
#
# @param [Symbol] attribute The attribute to retrieve
# @return [String] The value of the attribute
# @param [Symbol] name The attribute name to retrieve
# @return [String] The value of the attribute
#
def [](name)
attr_name = name.to_s
Expand Down
2 changes: 1 addition & 1 deletion lib/capybara/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def save_page(path=nil)
#
# Save a snapshot of the page and open it in a browser for inspection
#
# @param [String] path The path to where it should be saved [optional]
# @param [String] file_name The path to where it should be saved [optional]
#
def save_and_open_page(file_name=nil)
require "launchy"
Expand Down

0 comments on commit 30d5ccc

Please sign in to comment.