From 536433845d1d13b46483beac6bb5e7ba91008d2a Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 16 Jan 2012 11:21:20 -0800 Subject: silencing migrator tests, refactoring the migration test helper --- activerecord/lib/active_record/migration.rb | 3 ++- activerecord/test/cases/migration/helper.rb | 9 +++++++++ activerecord/test/cases/migration_test.rb | 23 +---------------------- activerecord/test/cases/migrator_test.rb | 1 + 4 files changed, 13 insertions(+), 23 deletions(-) diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index 2a9139749d..a79c7fac1d 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -341,13 +341,14 @@ module ActiveRecord cattr_accessor :verbose - attr_accessor :name, :version + attr_accessor :name, :version, :verbose def initialize(name = self.class.name, version = nil) @name = name @version = version @connection = nil @reverting = false + @verbose = self.class.verbose end # instantiate the delegate object after initialize is defined diff --git a/activerecord/test/cases/migration/helper.rb b/activerecord/test/cases/migration/helper.rb index 1a5ac1333e..fe53510ba2 100644 --- a/activerecord/test/cases/migration/helper.rb +++ b/activerecord/test/cases/migration/helper.rb @@ -2,6 +2,15 @@ require "cases/helper" module ActiveRecord class Migration + class << self + attr_accessor :message_count + end + + def puts(text="") + ActiveRecord::Migration.message_count ||= 0 + ActiveRecord::Migration.message_count += 1 + end + module TestHelper attr_reader :connection, :table_name diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index efb47b1844..9b80ea92a2 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -1,4 +1,5 @@ require "cases/helper" +require "cases/migration/helper" require 'bigdecimal/util' require 'models/person' @@ -16,28 +17,6 @@ class Reminder < ActiveRecord::Base; end class Thing < ActiveRecord::Base; end -class ActiveRecord::Migration - class << self - attr_accessor :message_count - end - - def puts(text="") - ActiveRecord::Migration.message_count ||= 0 - ActiveRecord::Migration.message_count += 1 - end -end - -module ActiveRecord - class MigrationTest < ActiveRecord::TestCase - attr_reader :connection - - def setup - super - @connection = Base.connection - end - end -end - class MigrationTest < ActiveRecord::TestCase self.use_transactional_fixtures = false diff --git a/activerecord/test/cases/migrator_test.rb b/activerecord/test/cases/migrator_test.rb index c14c485842..5553798cc7 100644 --- a/activerecord/test/cases/migrator_test.rb +++ b/activerecord/test/cases/migrator_test.rb @@ -1,4 +1,5 @@ require "cases/helper" +require "cases/migration/helper" module ActiveRecord class MigratorTest < ActiveRecord::TestCase -- cgit v1.2.3