Class | Spec::Expectations::ExpectationMatcherHandler |
In: |
lib/spec/expectations/handler.rb
|
Parent: | Object |
# File lib/spec/expectations/handler.rb, line 14 14: def handle_matcher(actual, matcher, &block) 15: unless matcher.respond_to?(:matches?) 16: raise InvalidMatcherError, "Expected a matcher, got #{matcher.inspect}." 17: end 18: 19: match = matcher.matches?(actual, &block) 20: ::Spec::Matchers.generated_description = "should #{describe_matcher(matcher)}" 21: Spec::Expectations.fail_with(matcher.failure_message) unless match 22: end