Class: Matchy::Expectations::RespondToExpectation
- Inherits:
-
Base
- Object
- Base
- Matchy::Expectations::RespondToExpectation
show all
- Defined in:
- lib/matchy/built_in/truth_expectations.rb
Instance Method Summary
collapse
Methods inherited from Base
#fail!, #initialize, #pass!
Instance Method Details
#failure_message ⇒ Object
126
127
128
|
# File 'lib/matchy/built_in/truth_expectations.rb', line 126
def failure_message
"Expected #{@receiver.inspect} to respond to #{@expected.inspect}."
end
|
#matches?(receiver) ⇒ Boolean
121
122
123
124
|
# File 'lib/matchy/built_in/truth_expectations.rb', line 121
def matches?(receiver)
@receiver = receiver
@receiver.respond_to?(@expected)
end
|
#negative_failure_message ⇒ Object
130
131
132
|
# File 'lib/matchy/built_in/truth_expectations.rb', line 130
def negative_failure_message
"Expected #{@receiver.inspect} to not respond to #{@expected.inspect}."
end
|