Sha256: 3eee717fe1c95b682aa73233a7030ff4177f322b5e64091292d91f5170c7d62a
Contents?: true
Size: 1.52 KB
Versions: 1
Compression:
Stored size: 1.52 KB
Contents
require 'spec_helper' describe 'Veritas::Optimizer::Logic::Predicate::Comparable::NeverEquivalent#optimizable?' do subject { object.optimizable? } let(:klass) { Class.new(Optimizer::Logic::Predicate) } let(:attribute) { Attribute::Integer.new(:id, :size => 1..10) } let(:predicate) { Logic::Predicate::Equality.new(left, right) } let(:object) { klass.new(predicate) } before do klass.class_eval { include Optimizer::Logic::Predicate::Comparable::NeverEquivalent } predicate.should be_kind_of(Logic::Predicate::Comparable) end context 'when left is a constant and is valid' do let(:left) { 1 } let(:right) { attribute } it { should be(false) } end context 'when left is a constand and is not valid' do let(:left) { 0 } let(:right) { attribute } it { should be(true) } end context 'when right is a constant and is valid' do let(:left) { attribute } let(:right) { 1 } it { should be(false) } end context 'when right is a constant and is not valid' do let(:left) { attribute } let(:right) { 0 } it { should be(true) } end context 'when left and right are joinable' do let(:left) { attribute } let(:right) { attribute } it { should be(false) } end context 'when left and right are not joinable' do let(:left) { attribute } let(:right) { Attribute::Integer.new(:id, :size => -10..0) } it { should be(true) } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
veritas-0.0.2 | spec/unit/veritas/optimizer/logic/predicate/comparable/never_equivalent/optimizable_spec.rb |