Sha256: 5ef2fb43702cc7bd72a5b07fffa93e9a7aa92f099d79f50e24319a2150c19c66

Contents?: true

Size: 978 Bytes

Versions: 10

Compression:

Stored size: 978 Bytes

Contents

require "cases/helper"

module ActiveRecord
  class Migration
    class LoggerTest < ActiveRecord::TestCase
      # MySQL can't roll back ddl changes
      self.use_transactional_fixtures = 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

10 entries across 10 versions & 2 rubygems

Version Path
ibm_db-3.0.4-x86-mingw32 test/cases/migration/logger_test.rb
ibm_db-3.0.4 test/cases/migration/logger_test.rb
ibm_db-3.0.3-x86-mingw32 test/cases/migration/logger_test.rb
ibm_db-3.0.3 test/cases/migration/logger_test.rb
ibm_db-3.0.2-x86-mingw32 test/cases/migration/logger_test.rb
ibm_db-3.0.2 test/cases/migration/logger_test.rb
activejob-lock-0.0.2 rails/activerecord/test/cases/migration/logger_test.rb
ibm_db-3.0.1 test/cases/migration/logger_test.rb
ibm_db-3.0.1-x86-mingw32 test/cases/migration/logger_test.rb
activejob-lock-0.0.1 rails/activerecord/test/cases/migration/logger_test.rb