module Rails::Dom::Testing::Assertions::SelectorAssertions

def css_select(*args)

end
...
inputs = css_select(form, "input")
forms.each do |form|
forms = css_select("form")
# Selects all form tags and then all inputs inside the form

items = css_select("ul>li")
# Selects all list items in unordered lists

end
# Do something fun with paragraphs here...
pars.each do |par|
pars = css_select("p")
# Selects all paragraph tags and does something interesting

divs = css_select("div")
# Selects all div tags

css_select returns nil if called with an invalid css selector.
The selector may be a CSS selector expression (String).

Returns an empty Nokogiri::XML::NodeSet if no match is found.
root element and any of its children.
element and the second argument as the selector. Attempts to match the
If called with two arguments, uses the first argument as the root

Returns an empty Nokogiri::XML::NodeSet if no match is found.

The default implementation of +document_root_element+ raises an exception explaining this.

the element returned in +document_root_element+
Called without an element +css_select+ selects from
If called with a single argument, uses that argument as a selector.

Select and return all matching elements.
def css_select(*args)
  raise ArgumentError, "you at least need a selector argument" if args.empty?
  root = args.size == 1 ? document_root_element : args.shift
  nodeset(root).css(args.first)
end