From d899991b48b6ecc56ffdf9919eb9b9275af5e7ae Mon Sep 17 00:00:00 2001 From: Tim Kelty Date: Tue, 24 Mar 2015 11:25:39 -0400 Subject: [PATCH] Add additional stubbing to tests for unexpected git environments. --- test/unit/tasks/deploy/update.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/unit/tasks/deploy/update.js b/test/unit/tasks/deploy/update.js index 3710a23..416f60a 100644 --- a/test/unit/tasks/deploy/update.js +++ b/test/unit/tasks/deploy/update.js @@ -40,6 +40,13 @@ describe('deploy:update task', function () { beforeEach(function () { sinon.stub(shipit, 'remote').resolves(); sinon.stub(shipit, 'remoteCopy').resolves(); + sinon.stub(shipit, 'local', function (command) { + if (command === 'git rev-parse ' + shipit.config.branch) { + return Promise.resolve( + {stdout: '9d63d434a921f496c12854a53cef8d293e2b4756\n'} + ); + } + }); }); afterEach(function () { @@ -67,6 +74,13 @@ describe('deploy:update task', function () { beforeEach(function () { sinon.stub(shipit, 'remote').resolves(); sinon.stub(shipit, 'remoteCopy').resolves(); + sinon.stub(shipit, 'local', function (command) { + if (command === 'git rev-parse ' + shipit.config.branch) { + return Promise.resolve( + {stdout: '9d63d434a921f496c12854a53cef8d293e2b4756\n'} + ); + } + }); }); afterEach(function () { shipit.remote.restore();