Sha256: 3c0d512b0b0af5fe0ad534dad094dea34515bad93bc10b587e4f8f215f287732
Contents?: true
Size: 678 Bytes
Versions: 3
Compression:
Stored size: 678 Bytes
Contents
# encoding: utf-8 require 'spec_helper' describe Optimizer::Relation::Operation::Binary::RightOrderOperand, '#optimizable?' do subject { object.optimizable? } let(:relation) { mock('Relation', :left => left, :right => right) } let(:left) { mock('Left') } let(:object) { described_class.new(relation) } context 'when right is an order' do let(:right) { Relation.new([ [ :id, Integer ] ], [].each).sort_by { |r| r.id } } it { should be(true) } end context 'when right is not an order' do let(:right) { Relation.new([ [ :id, Integer ] ], [].each) } it { should be(false) } end end
Version data entries
3 entries across 3 versions & 1 rubygems