code: function getPhantomExitCb (specId, allSpecs, cfg, done) {
          var spawnCb = function (error, result, code) {
              if (error) {
                  ok = false;
                  if (cfg.debug) {
                      console.log("PhantomJS exited with code "  + code);
                  }
              }
              var nextSpecId = specId + 1;
              if (nextSpecId == allSpecs.length) { // last spec
                  done(ok);
              } else {
                  startSpec (nextSpecId, allSpecs, cfg, done);
              }
          };
          return spawnCb;
      }
docs: Factory of phantom exit callbacks. Created callback for n-th spec runs the n+1-st spec,
  or finishes the grunt task for the last spec.
  @return {Function} standard node process-exit callback