Class: Crspec::Matchers::EndWithMatcher
- Inherits:
-
BaseMatcher
- Object
- BaseMatcher
- Crspec::Matchers::EndWithMatcher
- Defined in:
- lib/crspec/matchers.rb
Instance Attribute Summary
Attributes inherited from BaseMatcher
Instance Method Summary collapse
Methods inherited from BaseMatcher
#and, #failure_message_when_negated, #initialize, #or
Constructor Details
This class inherits a constructor from Crspec::Matchers::BaseMatcher
Instance Method Details
#failure_message ⇒ Object
580 581 582 |
# File 'lib/crspec/matchers.rb', line 580 def "Expected #{@actual.inspect} to end with #{@expected.inspect}" end |
#matches?(actual) ⇒ Boolean
569 570 571 572 573 574 575 576 577 578 |
# File 'lib/crspec/matchers.rb', line 569 def matches?(actual) @actual = actual if actual.respond_to?(:end_with?) actual.end_with?(@expected) elsif actual.is_a?(Array) actual.last(Array(@expected).size) == Array(@expected) else false end end |