Class: Crspec::Matchers::CompoundOrMatcher

Inherits:
CompoundAndMatcher show all
Defined in:
lib/crspec/matchers.rb

Instance Method Summary collapse

Methods inherited from CompoundAndMatcher

#and, #failure_message_when_negated, #initialize, #or

Constructor Details

This class inherits a constructor from Crspec::Matchers::CompoundAndMatcher

Instance Method Details

#failure_messageObject



66
67
68
# File 'lib/crspec/matchers.rb', line 66

def failure_message
  "#{@first.failure_message}\n...or:\n#{@second.failure_message}"
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/crspec/matchers.rb', line 62

def matches?(actual)
  @first.matches?(actual) || @second.matches?(actual)
end