Skip to content

Commit

Permalink
fixes tests for build
Browse files Browse the repository at this point in the history
Reworks the build module to be more testable (specifically the spawn).
  • Loading branch information
Matt Hernandez committed Sep 4, 2015
1 parent 44706e1 commit 181e3ef
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/build.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const Spawn = require('win-spawn');

const Hoek = require('hoek');
const Util = require('util');

const Exec = require('./exec');

const defaults = {
server: 'localhost',
directory: '.demeteorized'
Expand All @@ -29,7 +29,7 @@ module.exports = function (options, done) {

if (options.debug) args.push('--debug');

var build = Spawn('meteor', args, { cwd: options.input, stdio: 'inherit' });
var build = Exec.spawn('meteor', args, { cwd: options.input, stdio: 'inherit' });

build.on('error', function (err) {
done(err);
Expand Down
1 change: 1 addition & 0 deletions lib/exec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exports.spawn = require('win-spawn');
2 changes: 1 addition & 1 deletion test/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const Sinon = require('sinon');

var cpStub = {};
var Build = Proxyquire('../lib/build', {
'child_process': cpStub
'./exec': cpStub
});

var lab = exports.lab = Lab.script();
Expand Down

0 comments on commit 181e3ef

Please sign in to comment.