Class: Matchy::Expectations::ExcludeExpectation
- Inherits:
-
Base
- Object
- Base
- Matchy::Expectations::ExcludeExpectation
show all
- Defined in:
- lib/matchy/built_in/enumerable_expectations.rb
Instance Method Summary
collapse
Methods inherited from Base
#fail!, #initialize, #pass!
Instance Method Details
#failure_message ⇒ Object
32
33
34
|
# File 'lib/matchy/built_in/enumerable_expectations.rb', line 32
def failure_message
"Expected #{@receiver.inspect} to exclude #{@expected.inspect}."
end
|
#matches?(receiver) ⇒ Boolean
23
24
25
26
27
28
29
30
|
# File 'lib/matchy/built_in/enumerable_expectations.rb', line 23
def matches?(receiver)
@receiver = receiver
@expected.each do |o|
return false unless !receiver.include?(o)
end
true
end
|
#negative_failure_message ⇒ Object
36
37
38
|
# File 'lib/matchy/built_in/enumerable_expectations.rb', line 36
def negative_failure_message
"Expected #{@receiver.inspect} to not exclude #{@expected.inspect}."
end
|