Class: RSpec::Maybes::NegativeMaybeHandler

Inherits:
MaybeHandler
  • Object
show all
Defined in:
lib/rspec/maybes/handlers.rb

Class Method Summary collapse

Methods inherited from MaybeHandler

passes?

Class Method Details

.handle_matcher(actual, initial_matcher, message = nil, &block) ⇒ Object


43
44
45
46
47
48
# File 'lib/rspec/maybes/handlers.rb', line 43

def self.handle_matcher(actual, initial_matcher, message=nil, &block)
  matcher = super

  return ::RSpec::Matchers::BuiltIn::NegativeOperatorMatcher.new(actual) unless initial_matcher
  passes?(matcher) || MaybeHelper.handle_failure(matcher, message, :failure_message_when_negated)
end

.verbObject


50
51
52
# File 'lib/rspec/maybes/handlers.rb', line 50

def self.verb
  'might not'
end