       else
         [runCoreSpecs, runPackageSpecs]
 
-    async.series specs, (error, results) ->
+    method specs, (error, results) ->
       failedPackages = []
       coreSpecFailed = null
 

    resourcePath = process.cwd()
    appPath = getAppPath()

    packageSpecQueue = async.queue (packagePath, callback) ->
      options =
        cmd: appPath
        args: ['--test', "--resource-path=#{resourcePath}", path.join(packagePath, 'spec')]
        opts:
          cwd: packagePath
          env: _.extend({}, process.env, ELECTRON_ENABLE_LOGGING: true, ATOM_PATH: rootDir)

      grunt.log.ok "Launching #{path.basename(packagePath)} specs."
      spawn options, (error) ->
        failedPackages.push path.basename(packagePath) if error
        callback()


    resourcePath = process.cwd()
    coreSpecsPath = path.resolve('spec')

    if process.platform in ['darwin', 'linux']
      options =
        cmd: appPath
        args: ['--test', "--resource-path=#{resourcePath}", coreSpecsPath, "--user-data-dir=#{temp.mkdirSync('atom-user-data-dir')}"]
        opts:
          env: _.extend({}, process.env, {ELECTRON_ENABLE_LOGGING: true, ATOM_INTEGRATION_TESTS_ENABLED: true})
          stdio: 'inherit'

    else if process.platform is 'win32'
      options =
        cmd: process.env.comspec
        args: ['/c', appPath, '--test', "--resource-path=#{resourcePath}", '--log-file=ci.log', coreSpecsPath]
        opts:
          env: _.extend({}, process.env, {ELECTRON_ENABLE_LOGGING: true, ATOM_INTEGRATION_TESTS_ENABLED: true})
          stdio: 'inherit'

    grunt.log.ok "Launching core specs."
    spawn options, (error, results, code) ->
      if process.platform is 'win32'
        process.stderr.write(fs.readFileSync('ci.log')) if error
        fs.unlinkSync('ci.log')
      else
        # TODO: Restore concurrency on Windows
        packageSpecQueue?.concurrency = concurrency

      callback(null, error)

  grunt.registerTask 'run-specs', 'Run the specs', ->
    done = @async()
    startTime = Date.now()
    method =
      if concurrency is 1
        async.series
      else
        async.parallel

    specs =
      if process.env.ATOM_SPECS_TASK is 'packages'
