Sha256: 7954ae1370ee59ad65a348e8578bb1e248c140fb892bcb73f1eb7f95f2a910e6

Contents?: true

Size: 445 Bytes

Versions: 4

Compression:

Stored size: 445 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Relation, '#each' do
  include_context 'Relation'

  context 'with a block' do
    it 'yields objects' do
      retval = relation.each do |tuple|
        expect(tuple).to be_instance_of(model)
      end

      expect(retval).to be(relation)
    end
  end

  context 'without a block' do
    it 'returns enumerator' do
      expect(relation.each).to be_instance_of(Enumerator)
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
rom-0.2.0 spec/unit/rom/relation/each_spec.rb
rom-relation-0.1.2 spec/unit/rom/relation/each_spec.rb
rom-relation-0.1.1 spec/unit/rom/relation/each_spec.rb
rom-relation-0.1.0 spec/unit/rom/relation/each_spec.rb