Sha256: f876a0a59f2eb5e1d2c29574e3253706581568d0c166f2bae1083867f1032eeb
Contents?: true
Size: 1006 Bytes
Versions: 6
Compression:
Stored size: 1006 Bytes
Contents
# frozen_string_literal: true require "spec_helper" describe DataMigrate::SchemaDumper do let(:subject) { DataMigrate::SchemaDumper } let(:fixture_file_timestamps) do %w[20091231235959 20101231235959 20111231235959] end before do ActiveRecord::SchemaMigration.create_table DataMigrate::DataSchemaMigration.create_table DataMigrate::DataSchemaMigration.create(fixture_file_timestamps.map { |t| { version: t } }) end after do ActiveRecord::Migration.drop_table("data_migrations") rescue nil ActiveRecord::Migration.drop_table("schema_migrations") rescue nil end describe ".dump" do it "writes the define method with the version key to the stream" do stream = StringIO.new DataMigrate::SchemaDumper.dump(ActiveRecord::Base.connection, stream) stream.rewind last_version = fixture_file_timestamps.last expected = "DataMigrate::Data.define(version: #{last_version})" expect(stream.read).to include expected end end end
Version data entries
6 entries across 6 versions & 1 rubygems