 
 MigrationTest.addMigration new Migration8()
 
-# Store away for testing
+# Store away for testing.
 _TestMigrationTest = MigrationTest
 
 class MigrationTest extends MigrationTest

      db = MongoInternals.defaultRemoteCollectionDriver().mongo.db
      test.isTrue db

      # Reset migrated count
      Document.Migrations.update({}, {$set: {migrated: 0, all: 0}}, {multi: true})

      # We ignore any error
      db.dropCollection 'OlderMigrationTests', Meteor.bindEnvironment expect(->), (e) -> throw e
      db.dropCollection 'OldMigrationTests', Meteor.bindEnvironment expect(->), (e) -> throw e
      db.dropCollection 'MigrationTests', Meteor.bindEnvironment expect(->), (e) -> throw e

      testDefinition test, 0

      # We should be able to call migrate multiple times
      MigrationTest.migrate()

      testDefinition test, 0

      # We ignore any error
      db.dropCollection 'OlderMigrationTests', Meteor.bindEnvironment expect(->), (e) -> throw e
      db.dropCollection 'OldMigrationTests', Meteor.bindEnvironment expect(->), (e) -> throw e
      db.dropCollection 'MigrationTests', Meteor.bindEnvironment expect(->), (e) -> throw e

    replaceParent: true

if Meteor.isServer
  # Initialize the database.
  MigrationTest.documents.remove {}

testDefinition = (test, count) ->
