var fs = require('fs');
var exec = require('child_process').exec;
var should = require('chai').should();

// check an array of file path are existed or not
exports.assertPathsExist = function(paths, done) {
  var count, totalFileNum, isFinished;

  isFinished = function() {
    count++;
    if (count === totalFileNum) {
      done();
    }
  };

  totalFileNum = paths.length;
  count = 0;

  paths.forEach(function(path) {
    fs.exists(path, function(exists) {
      ("" + path + ":" + exists).should.equal("" + path + ":true");
      exists.should.equal(true);
      isFinished();
    });
  });
};

// check a file path is existed or not
exports.assertPathExist = function(path, done) {
  fs.exists(path, function(exists) {
    ("" + path + ":" + exists).should.equal("" + path + ":true");
    exists.should.equal(true);
    done();
  });
};

@@ -632,32 +632,28 @@
 sted or not%0A
-exports.
+var 
 assertPathEx
@@ -811,24 +811,24 @@
 qual(true);%0A
-
     done();%0A
@@ -824,20 +824,273 @@
    done();%0A  %7D);%0A%7D;%0A
+%0Aexports.assertPathExist = assertPathExist;%0A%0Aexports.genCommandTester = function(command, pathExist, done) %7B%0A  exec(command, function(error, stdout, stderr) %7B%0A    stdout.should.include('%5B-done:%5D');%0A    helpers.assertPathExist(pathExist, done);%0A  %7D);%0A%7D;%0A

add another help to handle repeated generate command testimng