Skip to content

Instantly share code, notes, and snippets.

@ben-ng ben-ng/cmd.js
Last active Dec 19, 2015

Embed
What would you like to do?
var assert = require('assert')
, cmd = require('../../lib/cmd')
, Cmd = cmd.Cmd
, tests;
tests = {
'Cmd parseArgs gen app defaults': function () {
console.log("FOO");
var c = new Cmd(['app', 'foo'], {});
assert.equal('gen:app[foo,default,default]', c.jakeTaskName);
console.log("BAZ");
}
, 'Cmd parseArgs gen app --jade': function () {
var c = new Cmd(['app', 'foo', '--jade']);
assert.equal('gen:app[foo,jade,default]', c.jakeTaskName);
}
, 'Cmd parseArgs gen scaffold zooby foo bar --realtime': function () {
var c = new Cmd(['scaffold', 'zooby', 'foo:int', 'bar:string',
'--realtime']);
assert.equal('gen:scaffold[zooby,foo:int%bar:string,default,realtime]',
c.jakeTaskName);
}
};
module.exports = tests;
MILK:geddy ben$ jake test
*** Running test/cli/cmd.js ***
Cmd parseArgs gen app defaults
FOO
BAZ
MILK:geddy ben$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.