Sha256: dabba5f10b39bbbab7fbb8870439b5a71a50ca9204ba84d0fd47e1fcda27a679

Contents?: true

Size: 753 Bytes

Versions: 1

Compression:

Stored size: 753 Bytes

Contents

require 'spec_helper'
module Alf
  class Database
    describe Connection, "relvar" do

      let(:conn){ sap_conn }

      context 'with a leaf operand' do
        subject{ conn.relvar{ suppliers } }

        it{ should be_a(Relvar::Base) }

        it 'has the expected name' do
          subject.expr.name.should eq(:suppliers)
        end

        it 'is bound to the serving connection' do
          subject.connection!.should be(conn)
        end
      end

      context 'with a complex expression' do
        subject{ conn.relvar{ project(suppliers, [:sid]) } }

        it{ should be_a(Relvar::Virtual) }

        it 'has the expected expression' do
          subject.expr.should be_a(Algebra::Project)
        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-database/connection/test_relvar.rb