mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Bring original puts back after finishing tests
This commit is contained in:
parent
9bb495e6ae
commit
17b837b3f1
2 changed files with 12 additions and 4 deletions
|
@ -5,10 +5,6 @@ module ActiveRecord
|
|||
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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue