Sha256: aebc752576c5288a14070faa8ad6bf78602f4e9e56065594420b9a5eab937295

Contents?: true

Size: 519 Bytes

Versions: 3

Compression:

Stored size: 519 Bytes

Contents

shared_context 'database setup' do
  include_context 'repository 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.1.0 spec/shared/database_setup.rb
rom-yesql-0.0.2 spec/shared/database_setup.rb
rom-yesql-0.0.1 spec/shared/database_setup.rb