Sha256: fc07d76ef772883ed28976d693c6c438e13c78d54d6856ae7fa47635186df9e7

Contents?: true

Size: 737 Bytes

Versions: 85

Compression:

Stored size: 737 Bytes

Contents

# frozen_string_literal: true

RSpec.describe :migrate_db do
  link :migrate_db, from: :ree_migrator

  before do
    Ree.enable_irb_mode
    require_relative('../../db')

    db = ReeMigratorTest::Db.new

    db.tables.each do |table|
      db.drop_table(table)
    end
  end

  after do
    Ree.disable_irb_mode
  end

  it {
    db = ReeMigratorTest::Db.new

    migrate_db(
      db,
      File.expand_path(
        File.join(__dir__, '../../sample_migrations/migrations.yml')
      )
    )

    data_first = db[:test_table].order(:id).first[:id]
    data_second = db[:test_table].order(:id).all.last[:id]

    expect(db[:test_table].columns.first).to eq(:id)
    expect(data_first).to eq(1)
    expect(data_second).to eq(10)
  }
end

Version data entries

85 entries across 85 versions & 1 rubygems

Version Path
ree_lib-1.0.124 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.123 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.122 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.121 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.120 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.119 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.118 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.117 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.116 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.115 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.114 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.113 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.112 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.111 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.110 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.109 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.108 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.107 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.106 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.105 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb