Sha256: c4428d680fdcd61c33042789bc0f01b348b6a2498a1515f9192ce49be1b42d84

Contents?: true

Size: 819 Bytes

Versions: 2

Compression:

Stored size: 819 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)        { double('Relation', left: left, right: right)      }
  let(:left)            { double('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

2 entries across 2 versions & 1 rubygems

Version Path
axiom-optimizer-0.2.0 spec/unit/axiom/optimizer/relation/operation/binary/empty_right/optimizable_predicate_spec.rb
axiom-optimizer-0.1.1 spec/unit/axiom/optimizer/relation/operation/binary/empty_right/optimizable_predicate_spec.rb