Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
SBoudrias committed Feb 14, 2016
1 parent 35d5d00 commit 28e93f7
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 35 deletions.
5 changes: 4 additions & 1 deletion lib/run-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ RunContext.prototype._run = function () {
RunContext.prototype.inDir = function (dirPath, cb) {
this.inDirSet = true;
var release = this.async();
var callBackThenRelease = _.compose(release, (cb || _.noop).bind(this, path.resolve(dirPath)));
var callBackThenRelease = _.flowRight(
release,
(cb || _.noop).bind(this, path.resolve(dirPath))
);
helpers.testDirectory(dirPath, callBackThenRelease);
return this;
};
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
},
"license": "MIT",
"dependencies": {
"inquirer": "^0.11.0",
"lodash": "^3.10.1",
"inquirer": "^0.12.0",
"lodash": "^4.3.0",
"mkdirp": "^0.5.1",
"rimraf": "^2.4.4",
"sinon": "^1.17.2",
"yeoman-environment": "^1.3.0",
"yeoman-generator": "^0.21.1"
"yeoman-environment": "^1.5.2",
"yeoman-generator": "^0.22.5"
}
}
12 changes: 0 additions & 12 deletions test/fixtures/custom-generator-simple/package.json

This file was deleted.

File renamed without changes.
12 changes: 7 additions & 5 deletions test/helpers.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*global it, describe, before, beforeEach, afterEach */
'use strict';
var util = require('util');
var path = require('path');
var assert = require('assert');
var sinon = require('sinon');
var RunContext = require('../lib/run-context');
var yeoman = require('yeoman-generator');
var yeoman = require('yeoman-environment');
var generators = require('yeoman-generator');
var helpers = require('../lib');
var env = yeoman();
var env = yeoman.createEnv();

describe('yeoman-test', function () {
beforeEach(function () {
Expand All @@ -19,12 +19,14 @@ describe('yeoman-test', function () {
self.options = options;
};

util.inherits(this.StubGenerator, yeoman.Base);
util.inherits(this.StubGenerator, generators.Base);
});

describe('.registerDependencies()', function () {
it('accepts dependency as a path', function () {
helpers.registerDependencies(env, ['./custom-generator-simple']);
helpers.registerDependencies(env, [
require.resolve('./fixtures/generator-simple/app')
]);
assert(env.get('simple:app'));
});

Expand Down
28 changes: 15 additions & 13 deletions test/run-context.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*global it, describe, before, beforeEach, afterEach */
'use strict';
var os = require('os');
var fs = require('fs');
Expand Down Expand Up @@ -37,7 +36,9 @@ describe('RunContext', function () {

describe('constructor', function () {
it('accept path parameter', function (done) {
var ctx = new RunContext(path.join(__dirname, './fixtures/custom-generator-simple'));
var ctx = new RunContext(
require.resolve('./fixtures/generator-simple/app')
);

ctx
.on('ready', function () {
Expand Down Expand Up @@ -211,16 +212,17 @@ describe('RunContext', function () {
it('optional `cb` can use `this.async()` to delay execution', function (done) {
var ctx = new RunContext(this.Dummy);
var delayed = false;
var cb = sinon.spy(function () {
var release = this.async();

setTimeout(function () {
delayed = true;
release();
}, 1);
});

ctx.inDir(this.tmp, cb)
ctx
.inDir(this.tmp, function () {
console.log('inDir callback');
var release = this.async();

setTimeout(function () {
delayed = true;
release();
}, 1);
})
.on('ready', function () {
assert(delayed);
})
Expand Down Expand Up @@ -394,7 +396,7 @@ describe('RunContext', function () {
describe('#withGenerators()', function () {
it('register paths', function (done) {
this.ctx.withGenerators([
path.join(__dirname, './fixtures/custom-generator-simple')
require.resolve('./fixtures/generator-simple/app')
]).on('ready', function () {
assert(this.ctx.env.get('simple:app'));
done();
Expand All @@ -412,7 +414,7 @@ describe('RunContext', function () {

it('allow multiple calls', function (done) {
this.ctx.withGenerators([
path.join(__dirname, './fixtures/custom-generator-simple')
require.resolve('./fixtures/generator-simple/app')
]).withGenerators([
[helpers.createDummyGenerator(), 'dummy:gen']
]).on('ready', function () {
Expand Down

0 comments on commit 28e93f7

Please sign in to comment.