Permalink
Browse files

silencing migrator tests, refactoring the migration test helper

  • Loading branch information...
1 parent 7312b83 commit 536433845d1d13b46483beac6bb5e7ba91008d2a @tenderlove tenderlove committed Jan 16, 2012
@@ -341,13 +341,14 @@ def self.migrate(direction)
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
@@ -2,6 +2,15 @@
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
@@ -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
@@ -1,4 +1,5 @@
require "cases/helper"
+require "cases/migration/helper"
module ActiveRecord
class MigratorTest < ActiveRecord::TestCase

0 comments on commit 5364338

Please sign in to comment.