Permalink
Browse files

Tests for file- and directory-task fixes.

  • Loading branch information...
1 parent 9cb8143 commit eda9a84e2c8d2a0f215e60cc289fec5a2a398d48 @mde mde committed Dec 22, 2011
Showing with 14 additions and 6 deletions.
  1. +1 −1 tests/Jakefile
  2. +12 −4 tests/file_task.js
  3. +1 −1 tests/helpers.js
View
@@ -129,9 +129,9 @@ namespace('fileTest', function () {
desc('File task, do not run unless the prereq file changes');
file('foo/from-src1.txt', ['fileTest:foo', 'fileTest:foo/src1.txt'], function () {
- console.log('fileTest:foo/from-src1.txt task');
var data = fs.readFileSync('foo/src1.txt');
fs.writeFileSync('foo/from-src1.txt', data);
+ console.log('fileTest:foo/from-src1.txt task');
}, {async: true});
});
View
@@ -25,10 +25,18 @@ var tests = new (function () {
};
this.testNoPrereqChange = function () {
- h.exec('../bin/cli.js fileTest:foo/from-src2.txt', function (out) {
- console.log(out);
- h.exec('../bin/cli.js fileTest:foo/from-src2.txt', function (out) {
- console.log(out);
+ h.exec('../bin/cli.js fileTest:foo/from-src1.txt', function (out) {
+ assert.equal('fileTest:foo/src1.txt task\nfileTest:foo/from-src1.txt task',
+ out);
+ h.exec('../bin/cli.js fileTest:foo/from-src1.txt', function (out) {
+ assert.equal('', out);
+ exec('rm -fr ./foo', function (err, stdout, stderr) {
+ if (err) { throw err }
+ if (stderr || stdout) {
+ console.log (stderr || stdout);
+ }
+ h.next();
+ });
});
});
};
View
@@ -24,7 +24,7 @@ var helpers = new (function () {
if (stderr) {
callback(stderr);
}
- else if (out) {
+ else {
callback(out);
}
});

0 comments on commit eda9a84

Please sign in to comment.