Sha256: 88c6dbdcd531b8bca6586bc0de5aeb27f45dab61a63e550f9eb0daf5e5b86979
Contents?: true
Size: 831 Bytes
Versions: 5
Compression:
Stored size: 831 Bytes
Contents
# encoding: utf-8 require 'spec_helper' describe Optimizer::Relation::Operation::Binary::EmptyRight, '#optimizable?' do subject { object.optimizable? } let(:described_class) { Class.new(Optimizer::Relation::Operation::Binary) } let(:relation) { mock('Relation', :left => left, :right => right) } let(:left) { mock('Left') } let(:object) { described_class.new(relation) } before do described_class.class_eval { include superclass::EmptyRight } end context 'when right is empty' do let(:right) { Relation::Empty.new([ [ :id, Integer ] ]) } it { should be(true) } end context 'when right is not empty' do let(:right) { Relation.new([ [ :id, Integer ] ], [ [ 1 ] ]) } it { should be(false) } end end
Version data entries
5 entries across 5 versions & 2 rubygems