Sha256: ed7ce42adc70102ce1f9cdf25b0b2e67330a2361aaf44e9d6e7ca5aa24f8a4b9

Contents?: true

Size: 901 Bytes

Versions: 5

Compression:

Stored size: 901 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe Sprinkle::Sequence do

  before do
    @sequence = Sprinkle::Sequence.new do
      section1 do
        'command1'
      end

      section2 do
        'command2'
      end
    end
  end

  describe 'during initialization' do

    it 'should yield the block, storing all section definitions provided' do
      @sequence.stages.size.should == 2
    end

  end

  describe 'during iteration' do

    before do
      @stages = { }
      @sequence.each do |stage, commands|
        @stages[stage] = commands
      end
    end

    it 'should yield to a given block with the stage and commands for that stage' do
      @stages.size.should == 2
      @stages.keys.should include(:section1)
      @stages[:section1].should == 'command1'
      @stages.keys.should include(:section2)
      @stages[:section2].should == 'command2'
    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sprinkle-0.3.3 spec/sprinkle/sequence_spec.rb
sprinkle-0.3.2 spec/sprinkle/sequence_spec.rb
sprinkle-0.3.1 spec/sprinkle/sequence_spec.rb
sprinkle-0.3.0 spec/sprinkle/sequence_spec.rb
sprinkle-0.1.4 spec/sprinkle/sequence_spec.rb