Sha256: 4b99955216231ef216231654f2095c498f0deef2fc1a8ad4921f3c9e0158b0a3

Contents?: true

Size: 703 Bytes

Versions: 3

Compression:

Stored size: 703 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Relation::Header, '#each' do
  subject { object.each { |tuple| yields << tuple } }

  let(:attribute) { Attribute::Integer.new(:id)        }
  let(:object)    { described_class.new([ attribute ]) }
  let(:yields)    { []                                 }

  it_should_behave_like 'an #each method'

  it 'yields each attribute' do
    expect { subject }.to change { yields.dup }.
      from([]).
      to([ attribute ])
  end
end

describe Relation::Header do
  subject { object.new }

  let(:object) { Relation::Header }

  it { should be_kind_of(Enumerable) }

  it 'case matches Enumerable' do
    (Enumerable === subject).should be(true)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
veritas-0.0.6 spec/unit/veritas/relation/header/each_spec.rb
veritas-0.0.5 spec/unit/veritas/relation/header/each_spec.rb
veritas-0.0.4 spec/unit/veritas/relation/header/each_spec.rb