Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: b1e5551422
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (29 sloc) 0.857 kB
require "cases/helper"
module ActiveRecord
class Migration
class LoggerTest < ActiveRecord::TestCase
Migration = Struct.new(:name, :version) do
def migrate direction
# do nothing
end
end
def setup
super
ActiveRecord::SchemaMigration.create_table
ActiveRecord::SchemaMigration.delete_all
end
def teardown
super
ActiveRecord::SchemaMigration.drop_table
end
def test_migration_should_be_run_without_logger
previous_logger = ActiveRecord::Base.logger
ActiveRecord::Base.logger = nil
migrations = [Migration.new('a', 1), Migration.new('b', 2), Migration.new('c', 3)]
ActiveRecord::Migrator.new(:up, migrations).migrate
ensure
ActiveRecord::Base.logger = previous_logger
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.