class Capybara::RSpecMatchers::Matchers::WrappedElementMatcher

def does_not_match?(actual, &filter_block)

def does_not_match?(actual, &filter_block)
  @filter_block ||= filter_block
  element_does_not_match?(wrap(actual))
rescue Capybara::ExpectationNotMet => e
  @failure_message_when_negated = e.message
  false
end

def matches?(actual, &filter_block)

def matches?(actual, &filter_block)
  @filter_block ||= filter_block
  element_matches?(wrap(actual))
rescue Capybara::ExpectationNotMet => e
  @failure_message = e.message
  false
end

def wrap(actual)

def wrap(actual)
  actual = actual.to_capybara_node if actual.respond_to?(:to_capybara_node)
  @context_el = if actual.respond_to?(:has_selector?)
    actual
  else
    Capybara.string(actual.to_s)
  end
end