Class: ComposableOperations::Matcher::SucceedToPerform::Matcher
- Inherits:
-
Object
- Object
- ComposableOperations::Matcher::SucceedToPerform::Matcher
- Defined in:
- lib/composable_operations/matcher/succeed_to_perform.rb
Instance Method Summary collapse
- #and_return(result) ⇒ Object
- #description ⇒ Object
- #failure_message ⇒ Object
- #matches?(operation) ⇒ Boolean
- #negative_failure_message ⇒ Object
Instance Method Details
#and_return(result) ⇒ Object
11 12 13 14 |
# File 'lib/composable_operations/matcher/succeed_to_perform.rb', line 11 def and_return(result) @result = result self end |
#description ⇒ Object
16 17 18 19 20 |
# File 'lib/composable_operations/matcher/succeed_to_perform.rb', line 16 def description description = "succeed to perform" description += " and return the expected result" if result description end |
#failure_message ⇒ Object
22 23 24 |
# File 'lib/composable_operations/matcher/succeed_to_perform.rb', line 22 def "the operation failed to perform for the following reason(s):\n#{failure_reasons}" end |
#matches?(operation) ⇒ Boolean
6 7 8 9 |
# File 'lib/composable_operations/matcher/succeed_to_perform.rb', line 6 def matches?(operation) self.operation = operation succeeded? && result_as_expected? end |
#negative_failure_message ⇒ Object
26 27 28 |
# File 'lib/composable_operations/matcher/succeed_to_perform.rb', line 26 def "the operation succeeded unexpectedly" end |