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

23 lines
601 B
Ruby
Raw Normal View History

2012-01-11 14:48:14 -05:00
require "cases/helper"
module ActiveRecord
class Migration
class LoggerTest < ActiveRecord::TestCase
2012-01-11 15:01:04 -05:00
Migration = Struct.new(:version) do
def migrate direction
# do nothing
end
end
2012-01-11 14:48:14 -05:00
def test_migration_should_be_run_without_logger
previous_logger = ActiveRecord::Base.logger
ActiveRecord::Base.logger = nil
2012-01-11 15:01:04 -05:00
migrations = [Migration.new(1), Migration.new(2), Migration.new(3)]
ActiveRecord::Migrator.new(:up, migrations).migrate
2012-01-11 14:48:14 -05:00
ensure
ActiveRecord::Base.logger = previous_logger
end
end
end
end