Sha256: a93d073ecd89780548439880a86ed0a27fe1f751768a0ae71eb01992d935f940

Contents?: true

Size: 600 Bytes

Versions: 28

Compression:

Stored size: 600 Bytes

Contents

module Spreedly

  module CommunicationHelper

    def get_request_body(response)
      remembered_body = nil

      @environment.define_singleton_method(:raw_ssl_request) do |method, enpoint, body, headers|
        remembered_body = body
        response
      end

      yield
      Nokogiri::XML(remembered_body)
    end

    def get_request_url(response)
      remembered_url = nil

      @environment.define_singleton_method(:raw_ssl_request) do |method, endpoint, body, headers|
        remembered_url = endpoint
        response
      end

      yield
      remembered_url
    end

  end

end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
spreedly-2.0.28 test/helpers/communication_helper.rb
spreedly-2.0.27 test/helpers/communication_helper.rb
spreedly-2.0.26 test/helpers/communication_helper.rb
spreedly-2.0.25 test/helpers/communication_helper.rb
spreedly-2.0.24 test/helpers/communication_helper.rb
spreedly-2.0.23 test/helpers/communication_helper.rb
spreedly-2.0.22 test/helpers/communication_helper.rb
spreedly-2.0.21 test/helpers/communication_helper.rb
spreedly-2.0.20 test/helpers/communication_helper.rb
spreedly-2.0.19 test/helpers/communication_helper.rb
spreedly-2.0.18 test/helpers/communication_helper.rb
spreedly-2.0.17 test/helpers/communication_helper.rb
spreedly-2.0.16 test/helpers/communication_helper.rb
spreedly-2.0.15 test/helpers/communication_helper.rb
spreedly-2.0.14 test/helpers/communication_helper.rb
spreedly-2.0.13 test/helpers/communication_helper.rb
spreedly-2.0.11 test/helpers/communication_helper.rb
spreedly-2.0.10 test/helpers/communication_helper.rb
spreedly-2.0.9 test/helpers/communication_helper.rb
spreedly-2.0.8 test/helpers/communication_helper.rb