Sha256: 74f3872f1e4ca767ee7c1b859316ef6078a748de41e96fc2c82b6bb28d977f1c

Contents?: true

Size: 540 Bytes

Versions: 2

Compression:

Stored size: 540 Bytes

Contents

require 'spec_helper'
module Finitio
  describe Heading, "each" do

    let(:a){ Attribute.new(:a, intType) }
    let(:b){ Attribute.new(:b, intType) }
    let(:h){ Heading.new([a, b]) }

    context 'without a block' do

      it 'should return an enumerator' do
        h.each.should be_a(Enumerator)
      end
    end

    context 'with a block' do

      it 'should yield each attribute in turn' do
        seen = []
        h.each do |attr|
          seen << attr
        end
        seen.should eq([a, b])
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
finitio-0.4.1 spec/unit/heading/test_each.rb
finitio-0.4.0 spec/unit/heading/test_each.rb