Adding documentation for Capybara::Result to be more explicit about what

Node#all returns.
This commit is contained in:
Matt Greenfield 2013-01-28 18:58:15 -05:00
parent 8368069cfd
commit 68fd350bb1
2 changed files with 18 additions and 1 deletions

View File

@ -105,7 +105,7 @@ module Capybara
# @option options [Boolean] visible Only find elements that are visible on the page. Setting this to false
# (the default, unless Capybara.ignore_hidden_elements = true), finds
# invisible _and_ visible elements.
# @return [Array[Capybara::Element]] The found elements
# @return [Capybara::Result] A collection of found elements
#
def all(*args)
query = Capybara::Query.new(*args)

View File

@ -1,6 +1,23 @@
require 'forwardable'
module Capybara
##
# A {Capybara::Result} represents a collection of {Capybara::Element} on the page. It is possible to interact with this
# collection similar to an Array because it implements Enumerable and offers the following Array methods through delegation:
#
# * []
# * each()
# * at()
# * size()
# * count()
# * length()
# * first()
# * last()
# * empty?()
#
# @see Capybara::Element
#
class Result
include Enumerable
extend Forwardable