Sha256: 1b6ba94026643fa8337c313bd972d982ad762cecf1ea9b21f948c9a0d4994c61

Contents?: true

Size: 746 Bytes

Versions: 1

Compression:

Stored size: 746 Bytes

Contents

require 'compiler_helper'
module Alf
  class Compiler
    describe Default, "wrap" do

      subject{
        compiler.call(expr)
      }

      let(:expr){
        wrap(an_operand(leaf), [:foo, :bar], :baz, allbut: true)
      }

      it_should_behave_like "a traceable compiled"

      it 'has a Wrap cog' do
        subject.should be_a(Engine::Wrap)
      end

      it 'has the correct wrapping' do
        subject.attributes.should eq(AttrList[:foo, :bar])
      end

      it 'has the correct as' do
        subject.as.should eq(:baz)
      end

      it 'has the correct allbut' do
        subject.allbut.should be_true
      end

      it 'has the correct sub-cog' do
        subject.operand.should be(leaf)
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alf-core-0.15.0 spec/unit/alf-compiler/default/test_wrap.rb