Permalink
Browse files

Reset ActiveRecord::Migration.verbose to the value before

  • Loading branch information...
1 parent 19cdec3 commit fb7eecad3074c83711ee93d45844f927bb9df731 @amatsuda amatsuda committed Aug 29, 2014
Showing with 5 additions and 2 deletions.
  1. +3 −1 activerecord/test/cases/migration_test.rb
  2. +2 −1 activerecord/test/cases/migrator_test.rb
View
4 activerecord/test/cases/migration_test.rb
@@ -34,7 +34,7 @@ def setup
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 @@ def setup
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
3 activerecord/test/cases/migrator_test.rb
@@ -23,11 +23,12 @@ def setup
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

0 comments on commit fb7eeca

Please sign in to comment.