Skip to content

Instantly share code, notes, and snippets.

@kwerle
Created April 19, 2010 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwerle/371575 to your computer and use it in GitHub Desktop.
Save kwerle/371575 to your computer and use it in GitHub Desktop.
def matches?(stringlike)
@document = Webrat::XML.document(stringlike)
@element = @document.inner_text
case @content
when String
@element.gsub(/\s+/, ' ').include?(@content)
when Regexp
@element.match(@content)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment