spec/unit/axiom/algebra/projection/each_spec.rb in axiom-0.1.0 vs spec/unit/axiom/algebra/projection/each_spec.rb in axiom-0.1.1

- old
+ new

@@ -3,14 +3,14 @@ require 'spec_helper' describe Algebra::Projection, '#each' do subject { object.each { |tuple| yields << tuple } } - let(:object) { described_class.new(relation, [ :id ]) } - let(:relation) { Relation.new([ [ :id, Integer ], [ :name, String ] ], body) } - let(:body) { [ [ 1, 'Dan Kubb' ], [ 2, 'Dan Kubb' ], [ 2, 'Alex Kubb'] ] } - let(:yields) { [] } + let(:object) { described_class.new(relation, [:id]) } + let(:relation) { Relation.new([[:id, Integer], [:name, String]], body) } + let(:body) { [[1, 'Dan Kubb'], [2, 'Dan Kubb'], [2, 'Alex Kubb']] } + let(:yields) { [] } it_should_behave_like 'an #each method' it 'yields only tuples' do subject @@ -21,10 +21,10 @@ subject yields.each { |tuple| tuple.header.should be(object.header) } end it 'yields only tuples with the expected data' do - expect { subject }.to change { yields.dup }. - from([]). - to([ [ 1 ], [ 2 ] ]) + expect { subject }.to change { yields.dup } + .from([]) + .to([[1], [2]]) end end