class RSpec::Expectations::NegativeExpectationHandler

@private

def self.does_not_match?(matcher, actual, &block)

def self.does_not_match?(matcher, actual, &block)
  if matcher.respond_to?(:does_not_match?)
    matcher.does_not_match?(actual, &block)
  else
    !matcher.matches?(actual, &block)
  end
end

def self.handle_matcher(actual, initial_matcher, custom_message=nil, &block)

def self.handle_matcher(actual, initial_matcher, custom_message=nil, &block)
  ExpectationHelper.with_matcher(self, initial_matcher, custom_message) do |matcher|
    return ::RSpec::Matchers::BuiltIn::NegativeOperatorMatcher.new(actual) unless initial_matcher
    negated_match_result = does_not_match?(matcher, actual, &block)
    if custom_message && negated_match_result.respond_to?(:error_generator)
      negated_match_result.error_generator.opts[:message] = custom_message
    end
    negated_match_result || ExpectationHelper.handle_failure(matcher, custom_message, :failure_message_when_negated)
  end
end

def self.opposite_should_method

def self.opposite_should_method
  :should
end

def self.should_method

def self.should_method
  :should_not
end

def self.verb

def self.verb
  'is expected not to'
end