Sha256: 9f5771185a74178da7bfcd802695330a24651ff447bd52eafa69b2d25346b8cf

Contents?: true

Size: 759 Bytes

Versions: 1

Compression:

Stored size: 759 Bytes

Contents

require 'spec_helper'
module Alf
  module Algebra
    module Operand
      describe Proxy, "to_cog" do

        subject{
          proxy.to_cog
        }

        let(:proxy){
          Proxy.new(proxied)
        }

        context 'when delegable' do
          let(:proxied){
            Struct.new(:to_cog).new(:compiled)
          }

          before do
            proxied.should respond_to(:to_cog)
          end

          it{ should eq(:compiled) }
        end

        context 'when non delegable' do
          let(:proxied){
            [{a: 1}]
          }

          it{ should be_a(Engine::Leaf) }

          it 'should be the correct proxy' do
            subject.operand.should be(proxied)
          end
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alf-core-0.15.0 spec/unit/alf-algebra/operand/proxy/test_to_cog.rb