Sha256: 9becd0570a114c2d168b51d6a5de0e520fbd5f54ab3d02a6df07e9749a8c48c1
Contents?: true
Size: 1.16 KB
Versions: 6
Compression:
Stored size: 1.16 KB
Contents
require 'spec_helper' require 'logger' describe Faraday::Conductivity::ExtendedLogging do subject(:log) { io.read } it "includes the HTTP verb" do log.should include "GET" end it "includes the request body" do log.should include "the request body" end it "includes the request headers" do log.should match %r"X-Foo\s+: bar" end it "includes the complete URL" do log.should include "http://widgets.example.org/test" end it "includes the response status" do log.should include "200" end it "includes the response time" do log.should match(/\d+\.\d+ms/) end it "includes the response headers" do log.should include "X-Bar : foo" end it "includes the response body" do log.should include "the response body" end before do perform_request io.rewind end let(:io) { StringIO.new } let(:logger) { Logger.new(io) } def perform_request connection.get("/test") do |request| request.headers["X-Foo"] = "bar" request.body = "the request body" end end def connection create_connection do |faraday| faraday.use :extended_logging, :logger => logger end end end
Version data entries
6 entries across 6 versions & 1 rubygems