<commit_before>/*global describe, beforeEach, it */
'use strict';

var path    = require('path')
  , _       = require('underscore')
  , assert  = require('assert')
  , helpers = require('yeoman-generator').test
  , promptFixture = {
    author:  '<NAME>'
  , email: '<EMAIL>'
  , url: 'http://github.com/johndoe'
  , license: 'MIT'
  }
  , expectedFixture = [
    'package.json'
  , '.editorconfig'
  , 'LICENSE.md'
  ];

describe('vanilla generator', function () {
  beforeEach(function (done) {
    helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
      if (err) {
        return done(err);
      }

      this.app = helpers.createGenerator('vanilla:app', [
        '../../app'
      , '../../addon'
      ]);
      this.app.options['skip-install'] = true;
      this.app.options['skip-welcome-message'] = true;

      done();
    }.bind(this));
  });

  it('can be imported without blowing up', function () {
    var app = require('../app');

    assert(app !== undefined);
  });

  describe('application', function () {
    it('creates expected files', function (done) {
      var prompt = _.extend({}, promptFixture, {
        type: 'Application'
      , name: 'Awesome App'
      , description: 'This is an awesome app!'
      , extras: [
          'class.hooks.php'
        , 'configuration.php'
        , 'bootstrap.php'
        , 'structure.php'
        ]
      })
      , expected = _.extend([], expectedFixture, [
        'settings/about.php'
      , 'settings/class.hooks.php'
      , 'settings/configuration.php'
      , 'settings/bootstrap.php'
      , 'settings/structure.php'
      ]);

      helpers.mockPrompt(this.app, prompt);

      this.app.run({}, function () {
        helpers.assertFile(expected);

        done();
      });
    });
  });

  describe('plugin', function () {
    it('creates expected files', function (done) {
      var prompt = _.extend({}, promptFixture, {
        type: 'Plugin'
      , name: 'Awesome Plugin'
      , description: 'This is an awesome plugin!'
      })
      , expected = _.extend([], expectedFixture, [
        'class.temp.plugin.php'
      ]);

      helpers.mockPrompt(this.app, prompt);

      this.app.run({}, function () {
        helpers.assertFile(expected);

        done();
      });
    });
  });

  describe('theme', function () {
    it('creates expected files', function (done) {
      var prompt = _.extend({}, promptFixture, {
        type: 'Theme'
      , name: 'Awesome Theme'
      , description: 'This is an awesome theme!'
      , extras: [
          'class.themehooks.php'
        ]
      })
      , expected = _.extend([], expectedFixture, [
        'about.php'
      , 'views/default.master.tpl'
      , 'class.themehooks.php'
      ]);

      helpers.mockPrompt(this.app, prompt);

      this.app.run({}, function () {
        helpers.assertFile(expected);

        done();
      });
    });
  });
});
<commit_msg>Nuke addon generator from spec<commit_after>/*global describe, beforeEach, it */
'use strict';

var path    = require('path')
  , _       = require('underscore')
  , assert  = require('assert')
  , helpers = require('yeoman-generator').test
  , promptFixture = {
    author:  '<NAME>'
  , email: '<EMAIL>'
  , url: 'http://github.com/johndoe'
  , license: 'MIT'
  }
  , expectedFixture = [
    'package.json'
  , '.editorconfig'
  , 'LICENSE.md'
  ];

describe('vanilla generator', function () {
  beforeEach(function (done) {
    helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
      if (err) {
        return done(err);
      }

      this.app = helpers.createGenerator('vanilla:app', [
        '../../app'
      ]);
      this.app.options['skip-install'] = true;
      this.app.options['skip-welcome-message'] = true;

      done();
    }.bind(this));
  });

  it('can be imported without blowing up', function () {
    var app = require('../app');

    assert(app !== undefined);
  });

  describe('application', function () {
    it('creates expected files', function (done) {
      var prompt = _.extend({}, promptFixture, {
        type: 'Application'
      , name: 'Awesome App'
      , description: 'This is an awesome app!'
      , extras: [
          'class.hooks.php'
        , 'configuration.php'
        , 'bootstrap.php'
        , 'structure.php'
        ]
      })
      , expected = _.extend([], expectedFixture, [
        'settings/about.php'
      , 'settings/class.hooks.php'
      , 'settings/configuration.php'
      , 'settings/bootstrap.php'
      , 'settings/structure.php'
      ]);

      helpers.mockPrompt(this.app, prompt);

      this.app.run({}, function () {
        helpers.assertFile(expected);

        done();
      });
    });
  });

  describe('plugin', function () {
    it('creates expected files', function (done) {
      var prompt = _.extend({}, promptFixture, {
        type: 'Plugin'
      , name: 'Awesome Plugin'
      , description: 'This is an awesome plugin!'
      })
      , expected = _.extend([], expectedFixture, [
        'class.temp.plugin.php'
      ]);

      helpers.mockPrompt(this.app, prompt);

      this.app.run({}, function () {
        helpers.assertFile(expected);

        done();
      });
    });
  });

  describe('theme', function () {
    it('creates expected files', function (done) {
      var prompt = _.extend({}, promptFixture, {
        type: 'Theme'
      , name: 'Awesome Theme'
      , description: 'This is an awesome theme!'
      , extras: [
          'class.themehooks.php'
        ]
      })
      , expected = _.extend([], expectedFixture, [
        'about.php'
      , 'views/default.master.tpl'
      , 'class.themehooks.php'
      ]);

      helpers.mockPrompt(this.app, prompt);

      this.app.run({}, function () {
        helpers.assertFile(expected);

        done();
      });
    });
  });
});

{'fraction_non_alphanumeric': 0.17257926306769494, 'fraction_numerical': 0.0, 'mean_word_length': 2.2048325096101045, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4349532', 'n_tokens_mistral': 1835, 'n_tokens_neox': 1798, 'n_words': 345}