Skip to content

Commit

Permalink
Bring original puts back after finishing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsuda committed Aug 29, 2014
1 parent 9bb495e commit 17b837b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 0 additions & 4 deletions activerecord/test/cases/migration/helper.rb
Expand Up @@ -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

Expand Down
12 changes: 12 additions & 0 deletions activerecord/test/cases/migrator_test.rb
Expand Up @@ -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
Expand Down

0 comments on commit 17b837b

Please sign in to comment.