lib/kelp/visibility.rb
# Return `true` if the current page contains the given text or regular expression,
# or `false` if it does not.
#
# @param [String, Regexp] text_or_regexp
#   Text or regular expression to look for
#
# @raise [ArgumentError]
#   If the given argument isn't a String or Regexp
#
# @since 0.2.0
#
Return `true` if the current page contains the given text or regular expression,
or `false` if it does not.
Return ` true ` if the current page contains the given text or regular expression or ` false ` if it does not .
def page_contains?(text_or_regexp)
      if text_or_regexp.class == String
        return page.has_content?(text_or_regexp)
      elsif text_or_regexp.class == Regexp
        return page.has_xpath?('.//*', :text => text_or_regexp)
      else
        raise ArgumentError, "Expected String or Regexp, got #{text_or_regexp.class}"
      end
    end
def page_contains? ( text_or_regexp ) if text_or_regexp . class == String return page . has_content? ( text_or_regexp ) elsif text_or_regexp . class == Regexp return page . has_xpath? ( './/*' , :text => text_or_regexp ) else raise ArgumentError , "Expected String or Regexp, got #{text_or_regexp.class}" end end
Return `true` if the current page contains the given text or regular expression,
or `false` if it does not.
Return ` true ` if the current page contains the given text or regular expression or ` false ` if it does not .
[ArgumentError] If the given argument isn't a String or Regexp
[ ArgumentError ] If the given argument isn ' t a String or Regexp
text_or_regexp
<not_specific>
<not_specific>
text_or_regexp Text or regular expression to look for
text_or_regexp Text or regular expression to look for
since
None