Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SBoudrias committed Jul 27, 2014
1 parent 062a345 commit 54ba3b9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"chalk": "^0.5.0",
"findup": "^0.1.3",
"fullname": "^0.1.0",
"insight": "^0.4.0",
"insight": "^0.3.1",
"is-root": "^0.1.0",
"lodash": "^2.4.1",
"multiline": "^0.3.4",
Expand All @@ -64,7 +64,8 @@
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-mocha-test": "^0.11.0",
"mockery": "^1.4.0"
"mockery": "^1.4.0",
"sinon": "^1.10.3"
},
"engineStrict": true,
"preferGlobal": true
Expand Down
2 changes: 1 addition & 1 deletion test/mocha.opts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--slow 1500
--timeout 50000
--timeout 5000

--reporter spec

Expand Down
1 change: 1 addition & 0 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*global describe, it, before, beforeEach, after, afterEach */
'use strict';
var fs = require('fs');
var path = require('path');
Expand Down
19 changes: 8 additions & 11 deletions test/yoyo.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/*global describe, it, before, beforeEach, after, afterEach */
'use strict';
var assert = require('assert');
var path = require('path');
var util = require('util');
var sinon = require('sinon');
var generator = require('yeoman-generator');
var helpers = require(path.join(path.dirname(require.resolve('yeoman-generator')), 'lib/test/helpers'));
var assert = require('assert');
var helpers = generator.test;
var env = generator();

var insightStub = {
Expand All @@ -18,10 +20,7 @@ var yo = function () {
};
env.registerStub(yoyo, 'yo');

function Phoenix() {
generator.Base.apply(this, arguments);
}
util.inherits(Phoenix, generator.Base);
var Phoenix = generator.Base.extend();
env.registerStub(Phoenix, 'phoenix:app');

describe('yo yo', function () {
Expand Down Expand Up @@ -145,12 +144,10 @@ describe('yo yo', function () {
it('should .run() desired generator', function (done) {
var fakeGenerator = 'generator-phoenix';

helpers.stub(yoyo.prototype.env = {}, 'run', function (generator, done) {
assert.equal(generator, fakeGenerator);
done();
});

var stub = sinon.stub(yoyo.prototype, 'composeWith');
yoyo.prototype._initGenerator(fakeGenerator, done);

sinon.assert.calledWith(stub, fakeGenerator);
});
});

Expand Down

0 comments on commit 54ba3b9

Please sign in to comment.