diff options
author | Akira Matsuda <ronnie@dio.jp> | 2014-08-29 09:40:33 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2014-08-29 10:34:26 +0900 |
commit | 17b837b3f10d52c5a39ef2f49930a1ffb1b66872 (patch) | |
tree | 2c290bc6f60d7a6c207fc298e3c63439d6bc6ec9 /activerecord/test/cases/migrator_test.rb | |
parent | 9bb495e6ae4de6d8c22f5e0cf81fbd86d95362e2 (diff) | |
download | rails-17b837b3f10d52c5a39ef2f49930a1ffb1b66872.tar.gz rails-17b837b3f10d52c5a39ef2f49930a1ffb1b66872.tar.bz2 rails-17b837b3f10d52c5a39ef2f49930a1ffb1b66872.zip |
Bring original puts back after finishing tests
Diffstat (limited to 'activerecord/test/cases/migrator_test.rb')
-rw-r--r-- | activerecord/test/cases/migrator_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/migrator_test.rb b/activerecord/test/cases/migrator_test.rb index a9e4a4d058..2574242b03 100644 --- a/activerecord/test/cases/migrator_test.rb +++ b/activerecord/test/cases/migrator_test.rb @@ -24,11 +24,23 @@ class MigratorTest < ActiveRecord::TestCase ActiveRecord::SchemaMigration.create_table ActiveRecord::SchemaMigration.delete_all rescue nil @verbose_was = ActiveRecord::Migration.verbose + ActiveRecord::Migration.class_eval do + undef :puts + def puts(*) + ActiveRecord::Migration.message_count += 1 + end + end end teardown do ActiveRecord::SchemaMigration.delete_all rescue nil ActiveRecord::Migration.verbose = @verbose_was + ActiveRecord::Migration.class_eval do + undef :puts + def puts(*) + super + end + end end def test_migrator_with_duplicate_names |