Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add test case for unable to run migration if ActiveRecord::Base.logge…

…r is nil (#3434)

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
commit ea2cbc86f7d73a4884a16530454908cff765c0dc 1 parent f4e5303
@sikachu sikachu authored josevalim committed
Showing with 10 additions and 0 deletions.
  1. +10 −0 activerecord/test/cases/migration_test.rb
View
10 activerecord/test/cases/migration_test.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.