Method: Object#should

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

#should(matcher = nil) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/mspec/expectations/should.rb', line 2

def should(matcher=nil)
  MSpec.expectation
  MSpec.actions :expectation, MSpec.current.state
  if matcher
    unless matcher.matches?(self)
      Expectation.fail_with(*matcher.failure_message)
    end
  else
    PositiveOperatorMatcher.new(self)
  end
end