Sha256: c08e4487b5ef6d3431ac1d55ab3755fb44a5478a1eb18da873ff65469a457cae

Contents?: true

Size: 522 Bytes

Versions: 3

Compression:

Stored size: 522 Bytes

Contents

RSpec.shared_context 'database setup' do
  include_context 'gateway setup'

  let!(:conn) { Sequel.connect(uri) }

  def drop_tables
    [:users, :tasks].each { |name| conn.drop_table?(name) }
  end

  before do
    conn.loggers << LOGGER

    drop_tables

    conn.create_table :users do
      primary_key :id
      String :name, null: false
      index :name, unique: true
    end

    conn.create_table :tasks do
      primary_key :id
      String :title, null: false
      index :title, unique: true
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rom-yesql-0.5.1 spec/shared/database_setup.rb
rom-yesql-0.5.0 spec/shared/database_setup.rb
rom-yesql-0.4.0 spec/shared/database_setup.rb