Exception: ConvenientService::RSpec::PrimitiveMatchers::Classes::DelegateTo::Exceptions::ReturnCustomValueChainingInvalidArguments

Inherits:
Exception
  • Object
show all
Defined in:
lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/exceptions.rb

Instance Method Summary collapse

Methods inherited from Exception

new

Instance Method Details

#initialize_without_argumentsObject



46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/exceptions.rb', line 46

def initialize_without_arguments
  message = <<~TEXT
    Returns custom value chaining has invalid arguments.

    Make sure you use one of the following forms:

    `and_return(custom_value)`
    `and_return { custom_value }`
    `and_return { |delegation_value| process_somehow(delegation_value) }`
  TEXT

  initialize(message)
end