Sha256: 7640d89853b7668ba9d83fc60bbe896ef4f8c0de771103fc48c434538191adbe

Contents?: true

Size: 773 Bytes

Versions: 4

Compression:

Stored size: 773 Bytes

Contents

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

      subject{ op.keys }

      let(:op){ 
        a_lispy.compact(operand)
      }

      context 'when the operand has a key' do
        let(:operand){
          an_operand.with_heading(:id => String, :name => String).
                     with_keys([ :id ])
        }
        let(:expected){
          Keys[ [ :id ] ]
        }

        it { should eq(expected) }
      end

      context 'when the operand has no key' do
        let(:operand){
          an_operand.with_heading(:id => String, :name => String).
                     with_keys()
        }
        let(:expected){
          Keys[ [ :id, :name ] ]
        }

        it { should eq(expected) }
      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/compact/test_keys.rb
alf-core-0.14.0 spec/unit/alf-algebra/operator/compact/test_keys.rb
alf-core-0.13.1 spec/unit/alf-algebra/operator/compact/test_keys.rb
alf-core-0.13.0 spec/unit/alf-algebra/operator/compact/test_keys.rb