24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/spec/expectations/handler.rb', line 24
def handle_matcher(actual, matcher, &block)
unless matcher.respond_to?(:negative_failure_message)
Spec::Expectations.fail_with(
<<-EOF
Matcher does not support should_not.
See Spec::Matchers for more information
about matchers.
EOF
)
end
match = matcher.matches?(actual, &block)
::Spec::Matchers.generated_description = "should not #{describe(matcher)}"
Spec::Expectations.fail_with(matcher.negative_failure_message) if match
end
|