Sha256: ec41b18206422e3edb72a9e95538b5f7153343fbb49c88b7ab3d1f6dd1b0a3e6

Contents?: true

Size: 424 Bytes

Versions: 4

Compression:

Stored size: 424 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Relation, '#to_a' do
  subject(:relation) { described_class.new(axiom_relation, mapper) }

  let(:axiom_relation) { [1, 2] }
  let(:loaded_objects) { %w(1 2) }
  fake(:mapper)

  before do
    stub(mapper).load(1) { '1' }
    stub(mapper).load(2) { '2' }
  end

  it 'gets all tuples and loads them via mapper' do
    expect(relation.to_a).to eql(loaded_objects)
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

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