Sha256: d639e13f8374aa84e7b1dbd820f3a94ccc6a42db1209f2b7de370d53df537dbc

Contents?: true

Size: 397 Bytes

Versions: 1

Compression:

Stored size: 397 Bytes

Contents

# encoding: utf-8

shared_examples_for 'Mapper::Loader#identity' do
  subject(:loader) { described_class.build(header, model) }

  let(:header) { Mapper::Header.build([[:id, Integer], [:name, String]], keys: [:id]) }
  let(:tuple)  { Hash[id: 1, name: 'Jane'] }
  let(:model)  { mock_model(:id, :name) }

  it "returns object's identity" do
    expect(loader.identity(tuple)).to eq([1])
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rom-0.2.0 spec/shared/unit/loader_identity.rb