forked from yeoman/yeoman
-
Notifications
You must be signed in to change notification settings - Fork 2
test generators
Mickael Daniel edited this page Jul 29, 2012
·
1 revision
-
Generators
- yeoman.generators
- yeoman.generators.Base
- yeoman.generators.NamedBase
- yeoman.generators.prepare
- yeoman.generators.init
- yeoman.generators.help
- yeoman.generators.printList
- yeoman.generators.invoke
- yeoman.generators.create
- yeoman.generators.findByNamespace
- yeoman.generators.lookup
- yeoman.generators.lookupHelp
- yeoman.generators.namespacesToPaths
assert.ok(yeoman.generators.Base);
should have a NamedBase object to extend from.
assert.ok(yeoman.generators.NamedBase);
assert.ok(this.generator instanceof events.EventEmitter);
assert.ok(typeof this.generator.on === 'function');
assert.ok(typeof this.generator.emit === 'function');
this.generator.on('yay-o-man', done);
this.generator.emit('yay-o-man');
assert.ok(this.generator instanceof yeoman.generators.Base);
and it should have a name property.
assert.equal(this.generator.name, 'namedArg');
assert.deepEqual(this.generators.args, ['some', 'args']);
should setup the invoked generator name from arguments.
assert.equal(this.generators.name, 'generatorname');
should setup the hash options from grunt.cli.options.
assert.deepEqual(this.generators.options, {
foo: 'bar',
bar: 'baz'
});
should prefix each positional arguments with init:
.
assert.deepEqual(this.tasks, ['init:yeoman', 'init:generatorname', 'init:some', 'init:args']);
and turn off the internal grunt help output.
assert.equal(this.options.help, false);
assert.equal(typeof this.generators.options.help, 'undefined');
assert.equal(this.generators.cwd, this.cwd);