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
# File lib/capybara/result.rb, line 39 def failure_message message = Capybara::Helpers.failure_message(@query.description, @query.options) if count > 0 message << ", found #{count} #{Capybara::Helpers.declension("match", "matches", count)}: " << @result.map(&:text).map(&:inspect).join(", ") else message << " but there were no matches" end unless @rest.empty? elements = @rest.map(&:text).map(&:inspect).join(", ") message << ". Also found " << elements << ", which matched the selector but not all filters." end message end
Generated with the Darkfish Rdoc Generator 2.