Sha256: 1aa874db05b9ab2f0bac5333f673d5cf9e775bee11c5afd8721f574f96ca3459

Contents?: true

Size: 627 Bytes

Versions: 5

Compression:

Stored size: 627 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'spec_helper'))

RSpec.describe HTTParty::Logger::CurlFormatter do
  describe "#format" do
    it "formats a response in a style that resembles a -v curl" do
      logger_double = double
      expect(logger_double).to receive(:info).with(
          /\[HTTParty\] \[\d{4}-\d\d-\d\d \d\d:\d\d:\d\d\ [+-]\d{4}\] > GET http:\/\/localhost/)

      subject = described_class.new(logger_double, :info)

      stub_http_response_with("google.html")

      response = HTTParty::Request.new.perform
      subject.format(response.request, response)
    end
  end
end

Version data entries

5 entries across 4 versions & 3 rubygems

Version Path
simplenet-client-0.2.0 ./vendor/bundle/ruby/1.9.1/gems/httparty-0.13.7/spec/httparty/logger/curl_formatter_spec.rb
simplenet-client-0.2.0 ./vendor/bundle/ruby/2.0.0/gems/httparty-0.13.7/spec/httparty/logger/curl_formatter_spec.rb
httparty-0.13.7 spec/httparty/logger/curl_formatter_spec.rb
httparty-0.13.6 spec/httparty/logger/curl_formatter_spec.rb
httpserious-0.13.5.lstoll1 spec/httparty/logger/curl_formatter_spec.rb