mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Add test case for unable to run migration if ActiveRecord::Base.logger is nil (#3434)
Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
committed by
José Valim
parent
f4e5303bcf
commit
ea2cbc86f7
@@ -1350,6 +1350,16 @@ if ActiveRecord::Base.connection.supports_migrations?
|
||||
end
|
||||
end
|
||||
|
||||
def test_migration_should_be_run_without_logger
|
||||
previous_logger = ActiveRecord::Base.logger
|
||||
ActiveRecord::Base.logger = nil
|
||||
assert_nothing_raised do
|
||||
ActiveRecord::Migrator.migrate(MIGRATIONS_ROOT + "/valid")
|
||||
end
|
||||
ensure
|
||||
ActiveRecord::Base.logger = previous_logger
|
||||
end
|
||||
|
||||
protected
|
||||
def with_env_tz(new_tz = 'US/Eastern')
|
||||
old_tz, ENV['TZ'] = ENV['TZ'], new_tz
|
||||
|
||||
Reference in New Issue
Block a user