Class: ComposableOperations::Matcher::Execution::SucceedToPerform

Inherits:
Base
  • Object
show all
Defined in:
lib/composable_operations/matcher/execution.rb

Instance Method Summary collapse

Methods inherited from Base

#and_return, #when_initialized_with

Instance Method Details

#descriptionObject



67
68
69
70
71
72
# File 'lib/composable_operations/matcher/execution.rb', line 67

def description
  description = "succeed to perform"
  description += " when initialized with custom input (#{input_as_text})" if input
  description += " and return the expected result (#{result_as_text})" if result
  description
end

#failure_messageObject



74
75
76
# File 'lib/composable_operations/matcher/execution.rb', line 74

def failure_message
  "the operation failed to perform for the following reason(s):\n#{failure_reasons}"
end

#failure_message_when_negatedObject Also known as: negative_failure_message



78
79
80
# File 'lib/composable_operations/matcher/execution.rb', line 78

def failure_message_when_negated
  "the operation succeeded unexpectedly"
end

#matches?(operation) ⇒ Boolean

Returns:

  • (Boolean)


62
63
64
65
# File 'lib/composable_operations/matcher/execution.rb', line 62

def matches?(operation)
  self.operation = operation
  succeeded? && result_as_expected?
end