Sha256: cd0b1120f88fd13689368a89ec401010a6289ba22d7905ff52cb88e39731b516
Contents?: true
Size: 940 Bytes
Versions: 1
Compression:
Stored size: 940 Bytes
Contents
require 'spec_helper' describe 'Veritas::Algebra::Union#each' do subject { object.each { |tuple| yields << tuple } } let(:klass) { Algebra::Union } let(:header) { [ [ :id, Integer ] ] } let(:left) { Relation.new(header, [ [ 1 ] ]) } let(:object) { klass.new(left, right) } let(:yields) { [] } context 'with relations having similar bodies' do let(:right) { left.dup } it_should_behave_like 'a command method' it 'yields each tuple' do expect { subject }.to change { yields.dup }. from([]). to([ [ 1 ] ]) end end context 'with relations having different bodies' do let(:right) { Relation.new(header, [ [ 2 ] ]) } it_should_behave_like 'a command method' it 'yields each tuple' do expect { subject }.to change { yields.dup }. from([]). to([ [ 1 ], [ 2 ] ]) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
veritas-0.0.2 | spec/unit/veritas/algebra/union/each_spec.rb |