lib/kelp/visibility.rb
# Verify the absence of content on the page. Passes when none of the given
# items are found on the page, and fails if any of them are found.
#
# @param [String, Regexp, Array] texts
#   Text(s) or Regexp(s) to look for
# @param [Hash] scope
#   Scoping keywords as understood by {#in_scope}
#
# @raise [Kelp::Unexpected]
#   If any of the expected text strings are seen in the given scope
#
Verify the absence of content on the page. Passes when none of the given
items are found on the page, and fails if any of them are found.
Verify the absence of content on the page . Passes when none of the given items are found on the page and fails if any of them are found .
def should_not_see(texts, scope={})
      in_scope(scope) do
        texts = [texts] if (texts.class == String || texts.class == Regexp)
        unexpected = texts.select do |text|
          page_contains?(text)
        end
        if !unexpected.empty?
          raise Kelp::Unexpected,
            "Expected not to see: #{texts.inspect}\nDid see: #{unexpected.inspect}"
        end
      end
    end
def should_not_see ( texts , scope = { } ) in_scope ( scope ) do texts = [ texts ] if ( texts . class == String || texts . class == Regexp ) unexpected = texts . select do | text | page_contains? ( text ) end if ! unexpected . empty? raise Kelp :: Unexpected , "Expected not to see: #{texts.inspect}\nDid see: #{unexpected.inspect}" end end end
Verify the absence of content on the page.
Verify the absence of content on the page .
# Select all unexpected values that do appear on the page
[Kelp::Unexpected] If any of the expected text strings are seen in the given scope
[ Kelp :: Unexpected ] If any of the expected text strings are seen in the given scope
texts
<not_specific>
scope
<not_specific>
<not_specific>
scope Scoping keywords as understood by {#in_scope}
scope Scoping keywords as understood by { #in_scope }