Sha256: 48f6a04c94773b94438a68aa8f08aecdae14be1aa093dc5dee92260814ed7373

Contents?: true

Size: 1.1 KB

Versions: 4

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

module ConvenientService
  module RSpec
    module Matchers
      module Classes
        module Results
          class Base
            module Exceptions
              class InvalidStep < ::ConvenientService::Exception
                ##
                # @api private
                #
                # @param step [ConvenientService::Service, Symbol]
                # @return [void]
                #
                def initialize_with_kwargs(step:)
                  message = <<~TEXT
                    Step `#{step}` is NOT valid.

                    `of_step` only accepts a Class or a Symbol. For example:

                    be_success.of_step(ReadFileContent)
                    be_success.of_step(:validate_path)
                    be_success.of_step(:result)

                    If you need to confirm that `result` has NO step - use `without_step` instead.

                    be_success.without_step
                  TEXT

                  initialize(message)
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
convenient_service-0.19.1 lib/convenient_service/rspec/matchers/classes/results/base/exceptions.rb
convenient_service-0.19.0 lib/convenient_service/rspec/matchers/classes/results/base/exceptions.rb
convenient_service-0.18.0 lib/convenient_service/rspec/matchers/classes/results/base/exceptions.rb
convenient_service-0.17.0 lib/convenient_service/rspec/matchers/classes/results/base/exceptions.rb