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



86
87
88
89
90
91
# File 'lib/composable_operations/matcher/execution.rb', line 86

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



93
94
95
# File 'lib/composable_operations/matcher/execution.rb', line 93

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

#failure_message_when_negatedObject



97
98
99
# File 'lib/composable_operations/matcher/execution.rb', line 97

def failure_message_when_negated
  "the operation succeeded unexpectedly"
end

#matches?(operation) ⇒ Boolean

Returns:

  • (Boolean)


81
82
83
84
# File 'lib/composable_operations/matcher/execution.rb', line 81

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