Sha256: c0198fac8d0f06916b63ce07c5b941d436f068f7cf3c9cf4dd881a60d8f73aef

Contents?: true

Size: 712 Bytes

Versions: 2

Compression:

Stored size: 712 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Algebra::Rename::SetOperand, '#optimize' do
  subject { object.optimize }

  let(:header)   { Relation::Header.coerce([[:id, Integer]])       }
  let(:left)     { Relation.new(header, LazyEnumerable.new([[1]])) }
  let(:right)    { Relation.new(header, LazyEnumerable.new([[2]])) }
  let(:relation) { left.union(right).rename(id: :other_id)         }
  let(:object)   { described_class.new(relation)                   }

  before do
    expect(object).to be_optimizable
  end

  it { should be_kind_of(Relation::Operation::Set) }

  its(:left) { should eql(left.rename(id: :other_id)) }

  its(:right) { should eql(right.rename(id: :other_id)) }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
axiom-optimizer-0.2.0 spec/unit/axiom/optimizer/algebra/rename/set_operand/optimize_spec.rb
axiom-optimizer-0.1.1 spec/unit/axiom/optimizer/algebra/rename/set_operand/optimize_spec.rb