提交 ea2cbc86 编写于 作者: P Prem Sichanugrist 提交者: José Valim

Add test case for unable to run migration if ActiveRecord::Base.logger is nil (#3434)

Signed-off-by: NJosé Valim <jose.valim@gmail.com>
上级 f4e5303b
......@@ -1350,6 +1350,16 @@ def test_create_table_with_custom_sequence_name
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册