Method: Mspec::Expect#to

Defined in:
lib/m-spec/core/expect.rb

#to(matcher) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/m-spec/core/expect.rb', line 9

def to(matcher)
  begin
    raise SpecError.new unless matcher.check(@value)
  rescue SpecError => e
    data = e
  end

  SpecResult.new(self, matcher, data)
end