Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a test to show that a FileTask within a namespace always executes…

… regardless of whether the file it depends upon has actually changed.

To run the test run jake bar:setup and then jake bar:src2.txt repeatedly and it will display 'doing src2.txt file-task' each time.
  • Loading branch information...
commit aeef316a01a0ee594e6b8b8ea0b082ebd5384014 1 parent 1a1723b
Page authored
Showing with 14 additions and 1 deletion.
  1. +14 −1 tests/Jakefile
View
15 tests/Jakefile
@@ -40,7 +40,7 @@ task('fonebone', function () {
directory('foo');
-desc('File task, concating two files together');
+desc('File task, concatenating two files together');
file({'foo/concat.txt': ['foo', 'foo/src1.txt', 'foo/src2.txt']}, function () {
console.log('doing concat.txt file-task');
var data1 = fs.readFileSync('foo/src1.txt');
@@ -138,7 +138,20 @@ namespace('foo', function () {
complete();
}, 0);
}, true);
+});
+
+namespace('bar', function() {
+ directory('bar');
+
+ task({'setup': 'bar:bar'}, function() {
+ fs.writeFileSync('bar/test.txt', 'test');
+ });
+ desc('Namespaced file task, don\'t run unless the prereq file changes');
+ file({'bar/src2.txt': 'bar/test.txt'}, function () {
+ console.log('doing src2.txt file-task');
+ fs.writeFileSync('bar/src2.txt', '');
+ });
});
Please sign in to comment.
Something went wrong with that request. Please try again.