Sha256: ebf18038f45d193320a008bdd2a089bcca32df6f592b88348acd3a9ac58ae50c

Contents?: true

Size: 1021 Bytes

Versions: 14

Compression:

Stored size: 1021 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Github::ResponseWrapper, '#headers' do
  let(:env) {
    { :response_headers => {
      'Content-Type' => "application/json; charset=utf-8",
      'X-RateLimit-Remaining' => '4999',
      'X-RateLimit-Limit' => '5000',
      'content-length' => '344',
      'ETag' => "\"d9a88f20567726e29d35c6fae87cef2f\"",
      'Server' => "nginx/1.0.4",
      'Date' => "Sun, 05 Feb 2012 15:02:34 GMT",
    }, :body => ['some'], :status => 200 }
  }
  let(:res) { Faraday::Response.new env }
  let(:object) { described_class.new res, nil }

  subject { object.headers }

  its(:content_type) { should match 'application/json' }

  its(:content_length) { should match '344' }

  its(:ratelimit_limit) { should == '5000' }

  its(:ratelimit_remaining) { should == '4999' }

  its(:status) { should be 200 }

  its(:etag) { should eql "\"d9a88f20567726e29d35c6fae87cef2f\"" }

  its(:date) { should eql "Sun, 05 Feb 2012 15:02:34 GMT" }

  its(:server) { should eql "nginx/1.0.4" }
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
github_api-0.12.2 spec/github/response_wrapper/headers_spec.rb
github_api-0.12.1 spec/github/response_wrapper/headers_spec.rb
github_api-0.12.0 spec/github/response_wrapper/headers_spec.rb
github_api-0.11.3 spec/github/response_wrapper/headers_spec.rb
github_api-0.11.2 spec/github/response_wrapper/headers_spec.rb
github_api-0.11.1 spec/github/response_wrapper/headers_spec.rb
github_api-0.11.0 spec/github/response_wrapper/headers_spec.rb
github_api-0.10.2 spec/github/response_wrapper/headers_spec.rb
github_api-0.10.1 spec/github/response_wrapper/headers_spec.rb
github_api-0.10.0 spec/github/response_wrapper/headers_spec.rb
github_api-0.9.7 spec/github/response_wrapper/headers_spec.rb
github_api-0.9.6 spec/github/response_wrapper/headers_spec.rb
github_api-0.9.5 spec/github/response_wrapper/headers_spec.rb
github_api-0.9.4 spec/github/response_wrapper/headers_spec.rb