Skip to content

Commit

Permalink
fixup doc generator test
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanpenner committed Apr 27, 2015
1 parent 35bd77a commit f7d55f4
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions tests/unit/utilities/doc-generator-test.js
Expand Up @@ -8,20 +8,17 @@ var path = require('path');

describe('generateDocs', function(){
it('calls the the appropriate command', function(){
var execFunc = function() {
var commandPath = '/node_modules/yuidocjs/lib/cli.js';
if (process.platform === 'win32') {
commandPath = escapeRegExp(path.normalize('/node_modules/.bin/yuidoc'));
}
var pattern = 'cd docs && .+' + commandPath + ' -q --project-version ' + escapeRegExp(calculateVersion());
console.log('Pattern: ' + pattern);
console.log('Argument: ' + arguments[0]);
function execFunc() {
var commandPath = escapeRegExp(path.normalize('/node_modules/.bin/yuidoc'));
var version = escapeRegExp(calculateVersion());
var pattern = 'cd docs && .+' + commandPath + ' -q --project-version ' + version;

expect((new RegExp(pattern)).test(arguments[0])).to.equal(true);
expect(arguments[0], 'yudoc command').to.match(new RegExp(pattern));
};

var generator = new DocGenerator({exec: execFunc});
generator.generate();
new DocGenerator({
exec: execFunc
}).generate();
});
});

Expand Down

0 comments on commit f7d55f4

Please sign in to comment.