Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bring original puts back after finishing tests

  • Loading branch information...
commit 17b837b3f10d52c5a39ef2f49930a1ffb1b66872 1 parent 9bb495e
@amatsuda amatsuda authored
View
4 activerecord/test/cases/migration/helper.rb
@@ -5,10 +5,6 @@ class Migration
class << self; attr_accessor :message_count; end
self.message_count = 0
- def puts(text="")
- ActiveRecord::Migration.message_count += 1
- end
-
module TestHelper
attr_reader :connection, :table_name
View
12 activerecord/test/cases/migrator_test.rb
@@ -24,11 +24,23 @@ def setup
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
Please sign in to comment.
Something went wrong with that request. Please try again.