Sha256: 878367b7a5365382061d1072b63c27044890324314a93941aeeed9794d4bfc4e

Contents?: true

Size: 392 Bytes

Versions: 4

Compression:

Stored size: 392 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Relation, '#first' do
  include_context 'Relation'

  context 'when limit is not provided' do
    it 'returns first object' do
      expect(relation.first.to_a).to eql([john])
    end
  end

  context 'when limit is provided' do
    it 'returns first n-objects' do
      expect(relation.first(2).to_a).to eql([john, jane])
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

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