Permalink
Browse files

remove dependency on the filesystem

  • Loading branch information...
1 parent 974a640 commit cc88ffed7a2e17ff53eb8796bc1fa2536ebca00d @tenderlove tenderlove committed Jan 11, 2012
Showing with 8 additions and 3 deletions.
  1. +8 −3 activerecord/test/cases/migration/logger_test.rb
@@ -3,12 +3,17 @@
module ActiveRecord
class Migration
class LoggerTest < ActiveRecord::TestCase
+ Migration = Struct.new(:version) do
+ def migrate direction
+ # do nothing
+ end
+ end
+
def test_migration_should_be_run_without_logger
previous_logger = ActiveRecord::Base.logger
ActiveRecord::Base.logger = nil
- assert_nothing_raised do
- ActiveRecord::Migrator.migrate(MIGRATIONS_ROOT + "/valid")
- end
+ migrations = [Migration.new(1), Migration.new(2), Migration.new(3)]
+ ActiveRecord::Migrator.new(:up, migrations).migrate
ensure
ActiveRecord::Base.logger = previous_logger
end

0 comments on commit cc88ffe

Please sign in to comment.