Sha256: 09d7328c1d05367b911c7a9374e3df0a610a018fb3158e44a1d319359d872199

Contents?: true

Size: 1011 Bytes

Versions: 6

Compression:

Stored size: 1011 Bytes

Contents

require "cases/helper"

module ActiveRecord
  class Migration
    class LoggerTest < ActiveRecord::TestCase
      # MySQL can't roll back ddl changes
      self.use_transactional_tests = false

      Migration = Struct.new(:name, :version) do
        def disable_ddl_transaction; false end
        def migrate direction
          # do nothing
        end
      end

      def setup
        super
        ActiveRecord::SchemaMigration.create_table
        ActiveRecord::SchemaMigration.delete_all
      end

      teardown do
        ActiveRecord::SchemaMigration.drop_table
      end

      def test_migration_should_be_run_without_logger
        previous_logger = ActiveRecord::Base.logger
        ActiveRecord::Base.logger = nil
        migrations = [Migration.new('a', 1), Migration.new('b', 2), Migration.new('c', 3)]
        ActiveRecord::Migrator.new(:up, migrations).migrate
      ensure
        ActiveRecord::Base.logger = previous_logger
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ibm_db-5.2.0-x86-mingw32 test/cases/migration/logger_test.rb
ibm_db-5.1.0-x86-mingw32 test/cases/migration/logger_test.rb
ibm_db-5.0.5-x86-mingw32 test/cases/migration/logger_test.rb
ibm_db-5.0.4-x86-mingw32 test/cases/migration/logger_test.rb
ibm_db-5.0.3-x86-mingw32 test/cases/migration/logger_test.rb
ibm_db-5.0.2-x86-mingw32 test/cases/migration/logger_test.rb