aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-01-16 11:21:20 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2012-01-16 11:21:20 -0800
commit536433845d1d13b46483beac6bb5e7ba91008d2a (patch)
treef7618c83359341c413ad84acf4e8b27495a19371
parent7312b8318f0c770d363a62d679aa8f67a18e549b (diff)
downloadrails-536433845d1d13b46483beac6bb5e7ba91008d2a.tar.gz
rails-536433845d1d13b46483beac6bb5e7ba91008d2a.tar.bz2
rails-536433845d1d13b46483beac6bb5e7ba91008d2a.zip
silencing migrator tests, refactoring the migration test helper
-rw-r--r--activerecord/lib/active_record/migration.rb3
-rw-r--r--activerecord/test/cases/migration/helper.rb9
-rw-r--r--activerecord/test/cases/migration_test.rb23
-rw-r--r--activerecord/test/cases/migrator_test.rb1
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