Sha256: c333d54aa0689ed7f185c1080cc04ee59002656c9e56a252e04069e504cdb5d3
Contents?: true
Size: 1.04 KB
Versions: 1
Compression:
Stored size: 1.04 KB
Contents
require 'spec_helper' describe 'Veritas::Relation#each' do subject { object.each { |tuple| yields << tuple } } let(:klass) { Relation } let(:header) { Relation::Header.new([ [ :id, Integer ] ]) } let(:body) { [ [ 1 ], [ 2 ], [ 2 ] ].each } # use an Enumerator let(:object) { klass.new(header, body) } let(:yields) { [] } before do object.should be_instance_of(klass) end it_should_behave_like 'a command method' it 'yields each tuple' do expect { subject }.to change { yields.dup }. from([]). to([ [ 1 ], [ 2 ] ]) end end describe 'Veritas::Relation' do subject { object.new(header, body) } let(:header) { [ [ :id, Integer ] ] } let(:body) { [ [ 1 ] ].each } let(:object) { Relation } before do subject.should be_instance_of(object) end it { should be_kind_of(Enumerable) } it 'case matches Enumerable' do (Enumerable === subject).should be(true) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
veritas-0.0.2 | spec/unit/veritas/relation/each_spec.rb |