Class: Crspec::Matchers::MatchMatcher
- Inherits:
-
BaseMatcher
- Object
- BaseMatcher
- Crspec::Matchers::MatchMatcher
- 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
413 414 415 |
# File 'lib/crspec/matchers.rb', line 413 def "Expected #{@actual.inspect} to match #{@expected.inspect}" end |
#matches?(actual) ⇒ Boolean
404 405 406 407 408 409 410 411 |
# File 'lib/crspec/matchers.rb', line 404 def matches?(actual) @actual = actual case @expected when Regexp then @expected.match?(actual.to_s) when String then actual.is_a?(Regexp) ? actual.match?(@expected) : actual == @expected else values_match?(@expected, actual) end end |