Sha256: f6e66e95c94e2340d93c55e73c90a153037dfc2d9849253c0ef27d2ffc79f48c

Contents?: true

Size: 614 Bytes

Versions: 6

Compression:

Stored size: 614 Bytes

Contents

require 'spec_helper'
module Sexpr
  describe Processor, "build_helper_chain" do

    def chain(helpers)
      Processor.build_helper_chain(helpers)
    end

    it 'returns a NullHelper instance when the chain is empty' do
      chain([]).should be_a(Processor::NullHelper)
    end

    it 'returns an instance of the first helper when a singleton chain' do
      chain([ FooHelper ]).should be_a(FooHelper)
    end

    it 'returns chained helpers when a list' do
      chain = chain([ FooHelper, BarHelper ])
      chain.should be_a(FooHelper)
      chain.next_in_chain.should be_a(BarHelper)
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sexpr-1.1.0 spec/unit/processor/test_build_helper_chain.rb
sexpr-1.0.0 spec/unit/processor/test_build_helper_chain.rb
sexpr-0.6.0 spec/unit/processor/test_build_helper_chain.rb
sexpr-0.5.1 spec/processor/test_build_helper_chain.rb
sexpr-0.5.0 spec/processor/test_build_helper_chain.rb
sexpr-0.4.0 spec/processor/test_build_helper_chain.rb