Sha256: cebe97f6d1f8e944870978095500b1f9e931b1a426f3e7dd2f3add96f80c61c0
Contents?: true
Size: 725 Bytes
Versions: 1
Compression:
Stored size: 725 Bytes
Contents
Shindo.tests("Excon support for middlewares that return canned responses") do the_body = "canned" canned_response_middleware = Class.new(Excon::Middleware::Base) do define_method :request_call do |params| params[:response] = { :body => the_body, :headers => {}, :status => 200 } super(params) end end connection = Excon.new( 'http://some-host.com/some-path', :method => :get, :middlewares => [canned_response_middleware] + Excon.defaults[:middlewares], :response_block => Proc.new { } # to force streaming ) tests('does not mutate the canned response body').returns("canned") do connection.request the_body end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
excon-0.30.0 | tests/middlewares/canned_response_tests.rb |