Sha256: 380c073928b9ac15657bb7aa7447cdee27aa33a001aa8f5ffbe40a7964dda3da
Contents?: true
Size: 786 Bytes
Versions: 4
Compression:
Stored size: 786 Bytes
Contents
# encoding: utf-8 require 'spec_helper' describe Optimizer::Algebra::Rename::UnoptimizedOperand, '#optimizable?' do subject { object.optimizable? } let(:header) { Relation::Header.new([ [ :id, Integer ] ]) } let(:base) { Relation.new(header, [ [ 1 ] ].each) } let(:relation) { operand.rename(aliases) } let(:aliases) { { :id => :other_id } } let(:object) { described_class.new(relation) } before do object.operation.should 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
4 entries across 4 versions & 1 rubygems