Sha256: 4e6946095ec13cbb4b687f5bd081a3540068968058886b1f4e67c912c588d549

Contents?: true

Size: 687 Bytes

Versions: 7

Compression:

Stored size: 687 Bytes

Contents

# frozen_string_literal: true

module Katalyst
  module Kpop
    module Matchers
      # @api private
      class ResponseMatcher < Base
        def match(_, actual)
          case actual
          when ::ActionDispatch::Response
            ::ActionDispatch::TestResponse.from_response(actual)
          when ::ActionDispatch::TestResponse
            actual
          end
        end

        def description
          "a response"
        end

        def failure_message
          "expected a response but received #{actual.inspect} instead"
        end

        def failure_message_when_negated
          "expected not to receive a response"
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
katalyst-kpop-3.2.6 lib/katalyst/kpop/matchers/response_matcher.rb
katalyst-kpop-3.2.5 lib/katalyst/kpop/matchers/response_matcher.rb
katalyst-kpop-3.2.4 lib/katalyst/kpop/matchers/response_matcher.rb
katalyst-kpop-3.2.3 lib/katalyst/kpop/matchers/response_matcher.rb
katalyst-kpop-3.2.2 lib/katalyst/kpop/matchers/response_matcher.rb
katalyst-kpop-3.2.1 lib/katalyst/kpop/matchers/response_matcher.rb
katalyst-kpop-3.2.0 lib/katalyst/kpop/matchers/response_matcher.rb