Sha256: ae0c3d241c02e59a0e3089464892d1242524134e72f815e47b23fd6a27415067

Contents?: true

Size: 738 Bytes

Versions: 39

Compression:

Stored size: 738 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

39 entries across 39 versions & 1 rubygems

Version Path
ree_lib-1.0.39 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.38 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.37 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.36 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.35 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.34 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.33 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.32 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.31 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.30 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.29 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.28 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.27 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.26 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.24 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.23 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.22 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.21 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.20 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb
ree_lib-1.0.19 lib/ree_lib/packages/ree_migrator/spec/ree_migrator/functions/migrate_db_spec.rb