Class: Matchy::Expectations::IncludeExpectation
- Inherits:
-
Base
- Object
- Base
- Matchy::Expectations::IncludeExpectation
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
13
14
15
|
# File 'lib/matchy/built_in/enumerable_expectations.rb', line 13
def failure_message
"Expected #{@receiver.inspect} to include #{@expected.inspect}."
end
|
#matches?(receiver) ⇒ Boolean
4
5
6
7
8
9
10
11
|
# File 'lib/matchy/built_in/enumerable_expectations.rb', line 4
def matches?(receiver)
@receiver = receiver
@expected.each do |o|
return false unless receiver.include?(o)
end
true
end
|
#negative_failure_message ⇒ Object
17
18
19
|
# File 'lib/matchy/built_in/enumerable_expectations.rb', line 17
def negative_failure_message
"Expected #{@receiver.inspect} to not include #{@expected.inspect}."
end
|