Permalink
Browse files

Add some tests for multiple namespace() calls. #144

  • Loading branch information...
1 parent d315cfa commit e0b244023fe47a9475161f0f5a9076f34bf96549 Chakrit Wichian committed Aug 17, 2012
Showing with 41 additions and 0 deletions.
  1. +14 −0 test/Jakefile
  2. +27 −0 test/namespace.js
View
@@ -197,4 +197,18 @@ namespace('vronk', function () {
});
});
+// define namespace
+namespace('one', function() {
+ task('one', function() {
+ console.log('one:one');
+ });
+});
+
+// modify namespace (add task)
+namespace('one', function() {
+ task('two', ['one:one'], function() {
+ console.log('one:two');
+ });
+});
+
View
@@ -0,0 +1,27 @@
+var assert = require('assert')
+ , h = require('./helpers')
+ , jake = {}
+ , utils = require('../lib/utils');
+
+utils.mixin(jake, utils);
+
+var tests = {
+ 'before': function() {
+ process.chdir('./test');
+ }
+
+, 'after': function() {
+ process.chdir('../');
+ }
+
+, 'test modifying a namespace by adding a new task': function(next) {
+ h.exec('../bin/cli.js one:two', function(out) {
+ assert.equal('one:one\none:two', out);
+ next();
+ });
+ }
+
+};
+
+module.exports = tests;
+

0 comments on commit e0b2440

Please sign in to comment.