diff --git a/test/exec.js b/test/exec.js index 7194a32..7106aed 100644 --- a/test/exec.js +++ b/test/exec.js @@ -65,6 +65,10 @@ shell.cd('../..'); // async // +// no callback (no need for asyncFlags) +shell.exec('node -e \"console.log(1234)\"', {async:true}); +assert.equal(shell.error(), null); + var asyncFlags = []; // @@ -118,20 +122,10 @@ shell.exec('node -e \"console.log(5678);\"', {async:true}, function(code, output child.exec('node '+file, function(err, stdout, stderr) { assert.ok(stdout === '222\n' || stdout === '222\nundefined\n'); // 'undefined' for v0.4 asyncFlags[3] = true; + + shell.exit(123); }); }); }); }); assert.equal(shell.error(), null); - -// no callback (no need for asyncFlags) -shell.exec('node -e \"console.log(1234)\"', {async:true}); -assert.equal(shell.error(), null); - -setTimeout(function() { - asyncFlags.forEach(function(flag) { - assert.equal(flag, true); - }); - - shell.exit(123); -}, 2000); diff --git a/test/to.js b/test/to.js index 35ddc48..4ce9893 100644 --- a/test/to.js +++ b/test/to.js @@ -20,18 +20,18 @@ shell.mkdir('tmp') // Invalids // -shell.echo('hello world').to(); +'hello world'.to(); assert.ok(shell.error()); assert.equal(fs.existsSync('/asdfasdf'), false); // sanity check -shell.echo('hello world').to('/asdfasdf/file'); +'hello world'.to('/asdfasdf/file'); assert.ok(shell.error()); // // Valids // -shell.echo('hello world').to('tmp/to1'); +'hello world'.to('tmp/to1'); var result = shell.cat('tmp/to1'); assert.equal(shell.error(), null); assert.equal(result, 'hello world');