Sha256: 73df4f890b3beede77c51d7189039bf0b4f973b1422896b7efc95f89979f8015
Contents?: true
Size: 907 Bytes
Versions: 1
Compression:
Stored size: 907 Bytes
Contents
require 'spec_helper' describe 'Veritas::Logic::Expression#optimize' do subject { object.optimize(*args) } let(:klass) { Class.new(Logic::Expression) } let(:object) { klass.new } before do klass.class_eval do def eql?(other) instance_of?(other.class) end end end context 'with no optimizer' do let(:args) { [] } it 'calls self.class.optimizer' do klass.should_receive(:optimizer).and_return(nil) subject end it 'returns self' do should equal(object) end it_should_behave_like 'an optimize method' end context 'with an optimizer' do let(:optimized) { klass.new } let(:args) { [ lambda { |relation| optimized } ] } it 'returns an optimized expression' do should equal(optimized) end it_should_behave_like 'an optimize method' end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
veritas-0.0.2 | spec/integration/veritas/logic/expression/optimize_spec.rb |