The match_text
and contain_tag
matchers support a counting interface to verify the number of occurrences of a given element specification within a document.
The following methods can be added to a match_text
or contain_tag
call:
#once
#twice
#times(n)
#at_least(:once)
, #at_least(:twice)
, #at_least.times(n)
#at_most(:once)
, #at_most(:twice)
, #at_most.times(n)