Permalink
Browse files

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

Node#all returns.
  • Loading branch information...
1 parent 8368069 commit 68fd350bb1d0fea6766678cc9ac246da207d1515 @mdgreenfield committed Jan 28, 2013
Showing with 18 additions and 1 deletion.
  1. +1 −1 lib/capybara/node/finders.rb
  2. +17 −0 lib/capybara/result.rb
@@ -105,7 +105,7 @@ def find_by_id(id)
# @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
@@ -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

0 comments on commit 68fd350

Please sign in to comment.