Sha256: 881a6f1b93e6ac5270f78e48fc97aaec1976fd4d9daa5ebdc87c90631a47e744

Contents?: true

Size: 726 Bytes

Versions: 45

Compression:

Stored size: 726 Bytes

Contents

RSpec.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

45 entries across 45 versions & 1 rubygems

Version Path
http-2.0.1 spec/lib/http/headers/mixin_spec.rb
http-2.0.0 spec/lib/http/headers/mixin_spec.rb
http-2.0.0.pre spec/lib/http/headers/mixin_spec.rb
http-1.0.4 spec/lib/http/headers/mixin_spec.rb
http-0.9.9 spec/lib/http/headers/mixin_spec.rb
http-1.0.3 spec/lib/http/headers/mixin_spec.rb
http-1.0.2 spec/lib/http/headers/mixin_spec.rb
http-1.0.1 spec/lib/http/headers/mixin_spec.rb
http-1.0.0 spec/lib/http/headers/mixin_spec.rb
http-1.0.0.pre6 spec/lib/http/headers/mixin_spec.rb
http-1.0.0.pre5 spec/lib/http/headers/mixin_spec.rb
http-1.0.0.pre4 spec/lib/http/headers/mixin_spec.rb
http-1.0.0.pre3 spec/lib/http/headers/mixin_spec.rb
http-1.0.0.pre2 spec/lib/http/headers/mixin_spec.rb
http-1.0.0.pre1 spec/lib/http/headers/mixin_spec.rb
http-0.9.8 spec/lib/http/headers/mixin_spec.rb
http-0.9.7 spec/lib/http/headers/mixin_spec.rb
http-0.9.6 spec/lib/http/headers/mixin_spec.rb
http-0.9.5 spec/lib/http/headers/mixin_spec.rb
http-0.9.4 spec/lib/http/headers/mixin_spec.rb