1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/cases/migration/logger_test.rb
2012-01-13 14:33:57 -08:00

22 lines
623 B
Ruby

require "cases/helper"
module ActiveRecord
class Migration
class LoggerTest < ActiveRecord::TestCase
Migration = Struct.new(:name, :version) do
def migrate direction
# do nothing
end
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