Method: Object#should_not

Defined in:
lib/mspec/expectations/should.rb

#should_not(matcher = nil) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/mspec/expectations/should.rb', line 14

def should_not(matcher=nil)
  MSpec.expectation
  MSpec.actions :expectation, MSpec.current.state
  if matcher
    if matcher.matches?(self)
      Expectation.fail_with(*matcher.negative_failure_message)
    end
  else
    NegativeOperatorMatcher.new(self)
  end
end