Sha256: 49d4069c24b2016358a7f51484f52c3089b55d227977c637038b175200a9f2ad

Contents?: true

Size: 641 Bytes

Versions: 4

Compression:

Stored size: 641 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Cookie::Header::Attribute::Set, '#each' do
  let(:attributes) { described_class.new(entries) }
  let(:entries)    { Hash[name => attribute] }
  let(:attribute)  { double('attribute', :to_s => name) }
  let(:name)       { double('name') }

  it 'returns self when a block is given' do
    expect(attributes.each { |_| }).to be(attributes)
  end

  it 'returns an enumerator when no block is given' do
    expect(attributes.each).to be_instance_of(Enumerator)
  end

  it 'yields all attributes' do
    expect { |block| attributes.each(&block) }.to yield_successive_args(attribute)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
majoun-0.0.4 spec/unit/cookie/header/attribute/set/each_spec.rb
majoun-0.0.3 spec/unit/cookie/header/attribute/set/each_spec.rb
majoun-0.0.2 spec/unit/cookie/header/attribute/set/each_spec.rb
majoun-0.0.1 spec/unit/cookie/header/attribute/set/each_spec.rb