Sha256: 674c0ed0d74f94cd53d575c07610954d8687b3932cba62f40b4389bf0549db33

Contents?: true

Size: 714 Bytes

Versions: 7

Compression:

Stored size: 714 Bytes

Contents

# frozen_string_literal: true

# :nocov:
require 'rack/auth/digest' unless defined?(Rack::Auth::Digest)
# :nocov:

module Rack
  module Test
    class MockDigestRequest_ # :nodoc:
      def initialize(params)
        @params = params
      end

      def method_missing(sym)
        if @params.key? k = sym.to_s
          return @params[k]
        end

        super
      end

      def method
        @params['method']
      end

      def response(password)
        Rack::Auth::Digest::MD5.new(nil).send :digest, self, password
      end
    end
    MockDigestRequest = MockDigestRequest_
    # :nocov:
    deprecate_constant :MockDigestRequest if respond_to?(:deprecate_constant, true)
    # :nocov:
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rack-test-2.0.2/lib/rack/test/mock_digest_request.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rack-test-2.0.2/lib/rack/test/mock_digest_request.rb
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/rack-test-2.0.2/lib/rack/test/mock_digest_request.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/rack-test-2.0.2/lib/rack/test/mock_digest_request.rb
rack-test-2.0.2 lib/rack/test/mock_digest_request.rb
rack-test-2.0.1 lib/rack/test/mock_digest_request.rb
rack-test-2.0.0 lib/rack/test/mock_digest_request.rb