Sha256: 5b1aa329ecfc8c3da2c7fde26351bb4f3072adb8238f1f6ad90997dabce04ad5

Contents?: true

Size: 963 Bytes

Versions: 1

Compression:

Stored size: 963 Bytes

Contents

require 'spec_helper'
module Alf
  module Algebra
    describe Operator, "to_ascii_tree" do

      subject{ operator.to_ascii_tree }

      context 'on an unary operator' do
        let(:operator){
          project(suppliers, [:sid, :name])
        }

        it 'returns the expected tree' do
          subject.should eq("project(..., [:sid, :name])\n+-- suppliers\n")
        end
      end

      context 'on an unary operator with options' do
        let(:operator){
          project(suppliers, [:sid, :name], allbut: true)
        }

        it 'returns the expected tree' do
          subject.should eq("project(..., [:sid, :name], {:allbut => true})\n+-- suppliers\n")
        end
      end

      context 'on an binary operator' do
        let(:operator){
          union(suppliers, parts)
        }

        it 'returns the expected tree' do
          subject.should eq("union(...)\n+-- suppliers\n+-- parts\n")
        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/commons/test_to_ascii_tree.rb