Sha256: 3ffa9830e16c6149d782ca047ac000c25a3b251a4d707ca8249f787b974a733a

Contents?: true

Size: 644 Bytes

Versions: 1

Compression:

Stored size: 644 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Relation::Operation::Offset, '#each' do
  subject { object.each { |tuple| yields << tuple } }

  let(:relation) { Relation.new([ [ :id, Integer ] ], [ [ 1 ], [ 2 ], [ 3 ] ]) }
  let(:order)    { relation.order                                              }
  let(:object)   { described_class.new(order, 1)                               }
  let(:yields)   { []                                                          }

  it_should_behave_like 'an #each method'

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
veritas-0.0.4 spec/unit/veritas/relation/operation/offset/each_spec.rb