before headless fix, but not animation factory is static class

This commit is contained in:
Peter Cottle 2013-06-05 18:48:59 -10:00
parent a7e515dd8c
commit d0e206bcc4
4 changed files with 56 additions and 49 deletions

View file

@ -16,6 +16,16 @@ var Command = require('../models/commandModel').Command;
var mock = require('../util/mock').mock;
var util = require('../util');
function getMockFactory() {
var mockFactory = {};
for (var key in AnimationFactory) {
mockFactory[key] = function() {
return Q.defer().promise;
};
}
return mockFactory;
}
var HeadlessGit = function() {
this.init();
};
@ -27,7 +37,7 @@ HeadlessGit.prototype.init = function() {
// here we mock visuals and animation factory so the git engine
// is headless
var animationFactory = mock(AnimationFactory);
var animationFactory = getMockFactory();
var gitVisuals = mock(GitVisuals);
this.gitEngine = new GitEngine({