1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Reset ActiveRecord::Migration.verbose to the value before

This commit is contained in:
Akira Matsuda 2014-08-29 09:27:26 +09:00
parent 19cdec3da8
commit fb7eecad30
2 changed files with 5 additions and 2 deletions

View file

@ -34,7 +34,7 @@ class MigrationTest < ActiveRecord::TestCase
Reminder.connection.drop_table(table) rescue nil
end
Reminder.reset_column_information
ActiveRecord::Migration.verbose = true
@verbose_was, ActiveRecord::Migration.verbose = ActiveRecord::Migration.verbose, true
ActiveRecord::Migration.message_count = 0
ActiveRecord::Base.connection.schema_cache.clear!
end
@ -65,6 +65,8 @@ class MigrationTest < ActiveRecord::TestCase
Person.connection.remove_column("people", "middle_name") rescue nil
Person.connection.add_column("people", "first_name", :string)
Person.reset_column_information
ActiveRecord::Migration.verbose = @verbose_was
end
def test_migrator_versions

View file

@ -23,11 +23,12 @@ class MigratorTest < ActiveRecord::TestCase
super
ActiveRecord::SchemaMigration.create_table
ActiveRecord::SchemaMigration.delete_all rescue nil
@verbose_was = ActiveRecord::Migration.verbose
end
teardown do
ActiveRecord::SchemaMigration.delete_all rescue nil
ActiveRecord::Migration.verbose = true
ActiveRecord::Migration.verbose = @verbose_was
end
def test_migrator_with_duplicate_names