Sha256: 3841269997c2c4cd8f6cf51f126b95bcca371259564e844c0d20f37f00f552c3
Contents?: true
Size: 815 Bytes
Versions: 2
Compression:
Stored size: 815 Bytes
Contents
# encoding: utf-8 require 'spec_helper' describe Optimizer::Algebra::Rename::UnoptimizedOperand, '#optimizable?' do subject { object.optimizable? } let(:header) { Relation::Header.coerce([[:id, Integer]]) } let(:base) { Relation.new(header, LazyEnumerable.new([[1]])) } let(:relation) { operand.rename(aliases) } let(:aliases) { { id: :other_id } } let(:object) { described_class.new(relation) } before do expect(object.operation).to be_kind_of(Algebra::Rename) end context 'when the operand is optimizable' do let(:operand) { base.rename({}) } it { should be(true) } end context 'when the operand is not optimizable' do let(:operand) { base } it { should be(false) } end end
Version data entries
2 entries across 2 versions & 1 rubygems