Sha256: 91424b944b83f09c752819d6c2af66f88fff09371e091fc72a6654f1741ca2c6

Contents?: true

Size: 676 Bytes

Versions: 4

Compression:

Stored size: 676 Bytes

Contents

require 'spec_helper'
module Alf
  module Algebra
    describe Extend, 'keys' do

      let(:operand){
        an_operand.with_heading(:id => Integer, :name => String).
                   with_keys([ :id ], [ :name ])
      }
      subject{ op.keys }

      context "when no key is touched by extensions" do
        let(:op){ 
          a_lispy.extend(operand, :computed => lambda{ 12 })
        }

        it { should eq(Keys[ [ :id ], [ :name ] ]) }
      end

      context "when keys are touched by extensions" do
        let(:op){ 
          a_lispy.extend(operand, :name => lambda{ 12 })
        }

        it { should eq(Keys[ [ :id ] ]) }
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
alf-core-0.15.0 spec/unit/alf-algebra/operator/extend/test_keys.rb
alf-core-0.14.0 spec/unit/alf-algebra/operator/extend/test_keys.rb
alf-core-0.13.1 spec/unit/alf-algebra/operator/extend/test_keys.rb
alf-core-0.13.0 spec/unit/alf-algebra/operator/extend/test_keys.rb