Sha256: 562169c2899bafa4d2283f15ac11d656a72680aa89d5289ece0f097e2eda80b9

Contents?: true

Size: 744 Bytes

Versions: 4

Compression:

Stored size: 744 Bytes

Contents

require 'spec_helper'
module Alf
  describe Tuple, '.allbut' do

    let(:type){ Tuple[name: String, status: Integer] }

    subject{ type.allbut(attr_list) }

    context 'with an empty attribute list' do
      let(:attr_list){ AttrList.new([]) }

      it 'allbuts as expected' do
        subject.should be(type)
      end
    end

    context 'with an non empty attribute list' do
      let(:attr_list){ AttrList.new([:name]) }

      it 'allbuts as expected' do
        subject.should eq(Tuple[status: Integer])
      end
    end

    context 'with a full attribute list' do
      let(:attr_list){ AttrList.new([:name, :status]) }

      it 'reuses the DUM class' do
        subject.should be(Tuple::DUM.class)
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
alf-core-0.15.0 spec/unit/alf-relation/tuple/factored-types/test_allbut.rb
alf-core-0.14.0 spec/unit/alf-relation/tuple/factored-types/test_allbut.rb
alf-core-0.13.1 spec/unit/alf-relation/tuple/factored-types/test_allbut.rb
alf-core-0.13.0 spec/unit/alf-relation/tuple/factored-types/test_allbut.rb