Sha256: 2f70ee469e45b084a052647c98e5c20dd31bfda52ced1067a6402ec93bfc635a

Contents?: true

Size: 572 Bytes

Versions: 1

Compression:

Stored size: 572 Bytes

Contents

require 'type_check_helper'
module Alf
  module Algebra
    describe Sort, 'type_check' do

      subject{ op.type_check }

      context 'when ok' do
        let(:op){ 
          sort(suppliers, [:name, :asc])
        }

        it{ should eq(op.heading) }
      end

      context 'when no such attribute' do
        let(:op){ 
          sort(suppliers, [:foo, :asc])
        }

        it 'should raise an error' do
          lambda{
            subject
          }.should raise_error(TypeCheckError, /no such attribute `foo`/)
        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/operator/sort/test_type_check.rb