'use strict';
var generators = require('yeoman-generator');

module.exports = generators.Base.extend({
  constructor: function () {
    generators.Base.apply(this, arguments);

    this.option('ui', {
      desc: 'Choose your style of DSL (bdd, tdd)',
      type: String
    });

    this.option('rjs', {
      desc: 'Add support for RequireJS',
      type: Boolean
    });
  },

  prompting: function () {
    var done = this.async();

    var prompts = [{
      type: 'list',
      name: 'ui',
      message: 'Choose your style of DSL',
      choices: ['BDD', 'TDD'],
      default: 'BDD',
      when: !this.options.ui
    }];

    this.prompt(prompts, function (answers) {
      this.options.ui = (this.options.ui || answers.ui).toLowerCase();
      done();
    }.bind(this));
  },

  configuring: function () {
    this.config.set('ui', this.options.ui);
    this.config.set('rjs', !!this.options.rjs);
  },

  writing: function () {
    this.template('test.js', 'test/spec/test.js');
    this.template('index.html', 'test/index.html');
  },

  install: function () {
    if (this.options['skip-install']) {
      return;
    }

    var dependencies = [
      'chai',
      'mocha'
    ];

    if (this.options.rjs) {
      dependencies.push('requirejs');
    }

    this.bowerInstall(dependencies, {saveDev: true});
  }
});

'use strict';
var generators = require('yeoman-generator');

module.exports = generators.Base.extend({
  constructor: function () {
    generators.Base.apply(this, arguments);

    this.option('ui', {
      desc: 'Choose your style of test DSL for Mocha (bdd, tdd)',
      type: String
    });

    this.option('rjs', {
      desc: 'Add support for RequireJS',
      type: Boolean
    });
  },

  prompting: function () {
    var done = this.async();

    var prompts = [{
      type: 'list',
      name: 'ui',
      message: 'Choose your style of DSL',
      choices: ['BDD', 'TDD'],
      default: 'BDD',
      when: !this.options.ui
    }];

    this.prompt(prompts, function (answers) {
      this.options.ui = (this.options.ui || answers.ui).toLowerCase();
      done();
    }.bind(this));
  },

  configuring: function () {
    this.config.set('ui', this.options.ui);
    this.config.set('rjs', !!this.options.rjs);
  },

  writing: function () {
    this.template('test.js', 'test/spec/test.js');
    this.template('index.html', 'test/index.html');
  },

  install: function () {
    if (this.options['skip-install']) {
      return;
    }

    var dependencies = [
      'chai',
      'mocha'
    ];

    if (this.options.rjs) {
      dependencies.push('requirejs');
    }

    this.bowerInstall(dependencies, {saveDev: true});
  }
});

Make the question more clear (for composition)
Make the question more clear (for composition)

When the generator is being composed, people using the other generator might not be aware of its presence, so it's unclear what "Choose your style of DSL" refers to.

Ref. yeoman/generator-webapp#545.
Ref. yeoman/generator-webapp#538.