1
require 'mocha/parameter_matchers/base'
5
module ParameterMatchers
7
# :call-seq: Not(matcher) -> parameter_matcher
9
# Matches if +matcher+ does not match.
11
# object.expects(:method_1).with(Not(includes(1)))
12
# object.method_1([0, 2, 3])
16
# object.expects(:method_1).with(Not(includes(1)))
17
# object.method_1([0, 1, 2, 3])
18
# # error raised, because method_1 was not called with object not including 1
23
class Not < Base # :nodoc:
25
def initialize(matcher)
29
def matches?(available_parameters)
30
parameter = available_parameters.shift
31
!@matcher.matches?([parameter])
35
"Not(#{@matcher.mocha_inspect})"
b'\\ No newline at end of file'