Sha256: 4f47966716f4df280be3669fb2f413ff10fb478b961dc569daa964f2af8f1c5c
Contents?: true
Size: 854 Bytes
Versions: 2
Compression:
Stored size: 854 Bytes
Contents
# encoding: utf-8 require 'spec_helper' describe Optimizer::Relation::Operation::Offset::UnoptimizedOperand, '#optimizable?' do subject { object.optimizable? } let(:header) { Relation::Header.coerce([[:id, Integer]]) } let(:base) { Relation.new(header, LazyEnumerable.new([[1]])).sort_by { |r| r.id } } let(:relation) { operand.drop(1) } let(:object) { described_class.new(relation) } before do expect(object.operation).to be_kind_of(Relation::Operation::Offset) 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