diff --git a/test/install.js b/test/install.js index 069e6aa0..32b10967 100644 --- a/test/install.js +++ b/test/install.js @@ -2,7 +2,6 @@ 'use strict'; var yeoman = require('yeoman-environment'); var generators = require('..'); -var assert = generators.assert; var helpers = generators.test; var TestAdapter = require('../lib/test/adapter').TestAdapter; var sinon = require('sinon'); @@ -36,44 +35,44 @@ describe('generators.Base (actions/install mixin)', function () { }; //args: installer, paths, options, cb this.dummy.runInstall('nestedScript', ['path1', 'path2'], spawnEnv, done); - assert.ok(this.spawnCommandStub.calledWithExactly('nestedScript', ['install', 'path1', 'path2'], spawnEnv)); + sinon.assert.calledWithExactly(this.spawnCommandStub, 'nestedScript', ['install', 'path1', 'path2'], spawnEnv); }); }); describe('#bowerInstall()', function () { it('spawn a bower process', function (done) { this.dummy.bowerInstall(null, done); - assert.ok(this.spawnCommandStub.calledOnce); - assert.ok(this.spawnCommandStub.calledWithExactly('bower', ['install'], {})); + sinon.assert.calledOnce(this.spawnCommandStub); + sinon.assert.calledWithExactly(this.spawnCommandStub, 'bower', ['install'], {}); }); it('spawn a bower process with formatted options', function (done) { this.dummy.bowerInstall('jquery', { saveDev: true }, done); - assert.ok(this.spawnCommandStub.calledOnce); - assert.ok(this.spawnCommandStub.calledWithExactly('bower', ['install', 'jquery', '--save-dev'], { saveDev: true })); + sinon.assert.calledOnce(this.spawnCommandStub); + sinon.assert.calledWithExactly(this.spawnCommandStub, 'bower', ['install', 'jquery', '--save-dev'], { saveDev: true }); }); }); describe('#npmInstall()', function () { it('run without callback', function () { this.dummy.npmInstall('yo', { save: true }); - assert.ok(this.spawnCommandStub.calledOnce); + sinon.assert.calledOnce(this.spawnCommandStub); }); }); describe('#installDependencies()', function () { it('spawn npm and bower', function (done) { this.dummy.installDependencies(function () { - assert.ok(this.spawnCommandStub.firstCall.calledWithExactly('bower', ['install'], {})); - assert.ok(this.spawnCommandStub.secondCall.calledWithExactly('npm', ['install'], {})); - + sinon.assert.calledTwice(this.spawnCommandStub); + sinon.assert.calledWithExactly(this.spawnCommandStub, 'bower', ['install'], {}); + sinon.assert.calledWithExactly(this.spawnCommandStub, 'npm', ['install'], {}); done(); }.bind(this)); }); it('doesn\'t spawn anything with skipInstall', function () { this.dummy.installDependencies({ skipInstall: true }); - assert.equal(this.spawnCommandStub.callCount, 0); + sinon.assert.notCalled(this.spawnCommandStub); }); it('call callback if skipInstall', function (done) {