 
   it 'should be able to run a migration', (done)->
     tableName = 'one_migration'
-    migrationDefinitionPath = path.resolve("test/specs/fixtures/migrations/definitions/one_migration.js")
-    migrationDefinition = require(migrationDefinitionPath)
     copyFixturesToMigrationsPath(tableName)
     Migrator.migrate(@adapter, migrationsPath, null, (err)=>
       return done(err) if err
       @ourAdapter.describe(tableName, (err, definition)->
         return done(err) if err
-        assert.equal(_.keys(definition).length, _.keys(migrationDefinition).length)
+        assert.equal(_.keys(definition).length, 3)
         done()
       )
     )
 
   it 'should be able to run 2 migrations', (done)->
     tableName = 'two_migrations'
-    migrationDefinitionPath = path.resolve("test/specs/fixtures/migrations/definitions/two_migrations.js")
-    migrationDefinition = require(migrationDefinitionPath)
     copyFixturesToMigrationsPath(tableName)
     Migrator.migrate(@adapter, migrationsPath, null, (err)=>
       return done(err) if err
       @ourAdapter.describe(tableName, (err, definition)->
         return done(err) if err
-        assert.equal(_.keys(definition).length, _.keys(migrationDefinition).length+1)
+        assert.equal(_.keys(definition).length, 4)
         done()
       )
     )

SailsIntegration = rek("lib/sails-migrations/sails_integration.coffee")
ourAdapter = rek("lib/sails-migrations/adapter.coffee")
migrationsPath = path.resolve('test/example_app/db/migrations')
definitionsPath = path.resolve('test/example_app/db/migrations/definitions')

cleanupMigrationFiles = (migrationsPath)->
  rmdirp.sync(migrationsPath)

  )

copyFixturesToMigrationsPath = (scope)->
  mkdirp.sync(migrationsPath) #This should create the db/migrations + db/migrations/definitions dirs in the example_app
  fixturePath = path.resolve('test/specs/fixtures/migrations')
  migrationFixtures = glob.sync("#{fixturePath}/*#{scope}*.js", {})
  copy(migrationFixtures, migrationsPath)

describe 'db:migrate', ->
  beforeEach (done)->
