Sha256: ee7cd105be9b98d29388ce1d0737be9a4d4f38a0c789af694edc5ac8e336ada0
Contents?: true
Size: 1.08 KB
Versions: 85
Compression:
Stored size: 1.08 KB
Contents
# frozen_string_literal: true package_require('ree_migrator/functions/apply_migrations') RSpec.describe :apply_migrations do link :apply_migrations, from: :ree_migrator link :create_migrations_table, 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 create_migrations_table(db) end after do Ree.disable_irb_mode end it { db = ReeMigratorTest::Db.new apply_migrations( db, File.expand_path( File.join(__dir__, '../../sample_migrations/migrations.yml') ), File.expand_path( File.join(__dir__, '../../sample_migrations/schema_migrations') ), File.expand_path( File.join(__dir__, '../../sample_migrations/data_migrations') ) ) data_first = db[:test_table].order(:id).first[:id] data_second = db[:test_table].order(:id).all[1][:id] expect(db[:test_table].columns.first).to eq(:id) expect(data_first).to eq(1) expect(data_second).to eq(2) } end
Version data entries
85 entries across 85 versions & 1 rubygems