Sha256: 5155d91c0274191d21371ea3d79c2eafe7138a313ed2d1b604e07003af445da3

Contents?: true

Size: 682 Bytes

Versions: 2

Compression:

Stored size: 682 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Relation::Operation::Binary::UnoptimizedOperands, '#optimize' do
  subject { object.optimize }

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

  before do
    expect(object).to be_optimizable
  end

  it { should be_kind_of(Algebra::Union) }

  it { should_not be(relation) }

  its(:left) { should be(left) }

  its(:right) { should be(right) }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
axiom-optimizer-0.2.0 spec/unit/axiom/optimizer/relation/operation/binary/unoptimized_operands/optimize_spec.rb
axiom-optimizer-0.1.1 spec/unit/axiom/optimizer/relation/operation/binary/unoptimized_operands/optimize_spec.rb