Sha256: 83567e133f08eddebc22ec97b10afe267c20dcfa92b2a7c328405c02025d2c94

Contents?: true

Size: 743 Bytes

Versions: 6

Compression:

Stored size: 743 Bytes

Contents

require 'spec_helper'

describe HTTP::Headers::Mixin do
  let :dummy_class do
    Class.new do
      include HTTP::Headers::Mixin

      def initialize(headers)
        @headers = headers
      end
    end
  end

  let(:headers) { HTTP::Headers.new }
  let(:dummy)   { dummy_class.new headers }

  describe '#headers' do
    it 'returns @headers instance variable' do
      expect(dummy.headers).to be headers
    end
  end

  describe '#[]' do
    it 'proxies to headers#[]' do
      expect(headers).to receive(:[]).with(:accept)
      dummy[:accept]
    end
  end

  describe '#[]=' do
    it 'proxies to headers#[]' do
      expect(headers).to receive(:[]=).with(:accept, 'text/plain')
      dummy[:accept] = 'text/plain'
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
http-0.6.4 spec/http/headers/mixin_spec.rb
http-0.6.3 spec/http/headers/mixin_spec.rb
http-0.6.2 spec/http/headers/mixin_spec.rb
http-0.6.1 spec/http/headers/mixin_spec.rb
http-0.6.0 spec/http/headers/mixin_spec.rb
http-0.6.0.pre spec/http/headers/mixin_spec.rb