Previously, if you had Capybara.asset_host defined and tried to
`save_page` on a document without a <head> tag (like plain text)
`inject_asset_host` would crash trying to string-replace a <base>
tag onto the nonexistant <head>.
Since there's probably no need for it to successfully inject a
<base> into such documents, now it will return the original content
when there is no <head> present.
- all() will now wait for the number of elements returned to match
the expected :count, :minimum, :maximum, :between query options.
- Helpers#matches_count? returns true if none of the count query
options are specified.
- Helpers#matches_count? tests multiple conditions if more than one
is specified. If :count is specified, however, it ignores others.
- Matchers#assert_selector allows checking for 0 matches when
the query options include {:count => 0}
Also move normalize_whitespace and to_regexp into Capybara::Helpers, and
improve method documentation.
I'm not adding tests for the helpers. I think they're so simple that we
really only care whether they work in conjunction with other methods,
like Node#text.