Sha256: ad60ca780007951d9b95ddbf40f295f63b89af26564a44871e6d218bd0d48b44

Contents?: true

Size: 796 Bytes

Versions: 6

Compression:

Stored size: 796 Bytes

Contents

RSpec.shared_context 'users and tasks' do
  subject(:rom) { setup.finalize }

  let(:setup) { ROM.setup(memory: "memory://localhost") }

  before do
    setup.schema do
      base_relation(:users) do
        repository :memory

        attribute :name
        attribute :email
      end

      base_relation(:tasks) do
        repository :memory

        attribute :name
        attribute :title
        attribute :priority
      end
    end

    db = setup.memory

    db[:users].insert(name: "Joe", email: "joe@doe.org")
    db[:users].insert(name: "Jane", email: "jane@doe.org")

    db[:tasks].insert(name: "Joe", title: "be nice", priority: 1)
    db[:tasks].insert(name: "Joe", title: "sleep well", priority: 2)

    db[:tasks].insert(name: "Jane", title: "be cool", priority: 2)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rom-0.5.0 spec/shared/users_and_tasks.rb
rom-0.4.2 spec/shared/users_and_tasks.rb
rom-0.4.1 spec/shared/users_and_tasks.rb
rom-0.4.0 spec/shared/users_and_tasks.rb
rom-0.3.1 spec/shared/users_and_tasks.rb
rom-0.3.0 spec/shared/users_and_tasks.rb