Sha256: 4e2a259a81871ab4d0676cfee07a7607e5bd85dba044f7152acca9ac3a6673ef

Contents?: true

Size: 854 Bytes

Versions: 6846

Compression:

Stored size: 854 Bytes

Contents

module Typhoeus
  class Request

    # This module handles stubbing on the request side.
    # It plays well with the block_connection configuration,
    # which raises when you make a request which is not stubbed.
    #
    # @api private
    module Stubbable

      # Override run in order to check for matching expectations.
      # When an expectation is found, super is not called. Instead a
      # canned response is assigned to the request.
      #
      # @example Run the request.
      #   request.run
      #
      # @return [ Response ] The response.
      def run
        if response = Expectation.response_for(self)
          execute_headers_callbacks(response)
          self.on_body.each{ |callback| callback.call(response.body, response) }
          finish(response)
        else
          super
        end
      end
    end
  end
end

Version data entries

6,846 entries across 6,843 versions & 28 rubygems

Version Path
ory-client-0.0.1.alpha77 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb
ory-client-0.0.1.alpha76 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb
ory-client-0.0.1.alpha75 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb
ory-client-0.0.1.alpha74 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb
ory-client-0.0.1.alpha73 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb
ory-client-0.0.1.alpha72 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb
ory-client-0.0.1.alpha71 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb
ory-client-0.0.1.alpha70 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb
ory-client-0.0.1.alpha69 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb
ory-client-0.0.1.alpha68 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb
ory-client-0.0.1.alpha67 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb
ory-client-0.0.1.alpha66 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb
ory-oathkeeper-client-0.38.19.beta1 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb
ory-oathkeeper-client-0.38.18.beta1 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb
ory-oathkeeper-client-0.38.17.beta1 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb
avalara_sdk-2.4.7 vendor/bundle/ruby/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb
ory-client-0.0.1.alpha58 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb
ory-client-0.0.1.alpha57 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb
ory-client-0.0.1.alpha56 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb
ory-client-0.0.1.alpha55 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/lib/typhoeus/request/stubbable.rb