Sha256: 115aaa78366a7bf2090713ed0751706555b7f71b3b50d994137aa5db23054858

Contents?: true

Size: 695 Bytes

Versions: 3

Compression:

Stored size: 695 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Algebra::Join, '#each' do
  subject { object.each { |tuple| yields << tuple } }

  let(:left)   { Relation.new([ [ :id, Integer ] ], [ [ 1 ], [ 2 ] ])                         }
  let(:right)  { Relation.new([ [ :id, Integer ], [ :name, String ] ], [ [ 2, 'Dan Kubb' ] ]) }
  let(:object) { described_class.new(left, right)                                             }
  let(:yields) { []                                                                           }

  it_should_behave_like 'an #each method'

  it 'yields each tuple' do
    expect { subject }.to change { yields.dup }.
      from([]).
      to([ [ 2, 'Dan Kubb' ] ])
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
veritas-0.0.6 spec/unit/veritas/algebra/join/each_spec.rb
veritas-0.0.5 spec/unit/veritas/algebra/join/each_spec.rb
veritas-0.0.4 spec/unit/veritas/algebra/join/each_spec.rb