Class: Spec::Expectations::ExpectationMatcherHandler

Inherits:
Object
  • Object
show all
Extended by:
MatcherHandlerHelper
Defined in:
lib/spec/expectations/handler.rb

Class Method Summary collapse

Methods included from MatcherHandlerHelper

describe

Class Method Details

.handle_matcher(actual, matcher, &block) ⇒ Object



13
14
15
16
17
# File 'lib/spec/expectations/handler.rb', line 13

def handle_matcher(actual, matcher, &block)
  match = matcher.matches?(actual, &block)
  ::Spec::Matchers.generated_description = "should #{describe(matcher)}"
  Spec::Expectations.fail_with(matcher.failure_message) unless match
end