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

var path    = require('path');
var helpers = require('yeoman-generator').test;

var basicExpected = [
  'Gruntfile.js',
  '.bowerrc',
  '.gitignore',
  'bower.json',
  'app.js',
  'public/img',
  'public/components',
  'public/js',
  'public/css/style.css',
  'package.json',
  'routes/index.js',
  'routes/user.js'
];
describe('Basic generator with Jade', function () {
  beforeEach(function (done) {
    helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
      if (err) {
        return done(err);
      }

      this.app = helpers.createGenerator('express:app', [
        '../../app'
      ]);
      done();
    }.bind(this));
  });

  it('creates expected files', function (done) {
    var expected = [
      'views/index.jade',
      'views/layout.jade',
      'views/404.jade'
    ];
    var allExpected = expected.concat(basicExpected);
    this.app.options.basic = true;
    this.app.options.viewEngine = 'Jade';
    this.app.options['skip-install'] = true;
    this.app.run({}, function () {
      helpers.assertFiles(allExpected);
      done();
    });
  });
});

var MVCExpected = [
  'Gruntfile.js',
  '.bowerrc',
  '.gitignore',
  'bower.json',
  'app.js',
  'public/img',
  'public/components',
  'public/js',
  'public/css',
  'package.json',
  'config/config.js',
  'config/express.js',
  'app/controllers',
  'app/controllers/home.js',
  'app/models',
  'app/views'
];

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

      this.app = helpers.createGenerator('express:app', [
        '../../app'
      ]);

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

  it('creates expected files', function (done) {
    var expected = [
      'app/views/layout.jade',
      'app/views/404.jade',
      'app/views/index.jade'
    ];
    var allExpected = expected.concat(MVCExpected);

    this.app.options.mvc = true;
    this.app.options.viewEngine = 'Jade';
    this.app.options['skip-install'] = true;
    this.app.run({}, function () {
      helpers.assertFiles(allExpected);
      done();
    });
  });
});<commit_msg>added tests for ejs, closing #23<commit_after>/*global describe, beforeEach, it*/
'use strict';

var path    = require('path');
var helpers = require('yeoman-generator').test;

var basicExpected = [
  'Gruntfile.js',
  '.bowerrc',
  '.gitignore',
  'bower.json',
  'app.js',
  'public/img',
  'public/components',
  'public/js',
  'public/css/style.css',
  'package.json',
  'routes/index.js',
  'routes/user.js'
];
describe('Basic generator with Jade', function () {
  beforeEach(function (done) {
    helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
      if (err) {
        return done(err);
      }

      this.app = helpers.createGenerator('express:app', [
        '../../app'
      ]);
      done();
    }.bind(this));
  });

  it('creates expected files', function (done) {
    var expected = [
      'views/index.jade',
      'views/layout.jade',
      'views/404.jade'
    ];
    var allExpected = expected.concat(basicExpected);
    this.app.options.basic = true;
    this.app.options.viewEngine = 'jade';
    this.app.options['skip-install'] = true;
    this.app.run({}, function () {
      helpers.assertFiles(allExpected);
      done();
    });
  });
});

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

      this.app = helpers.createGenerator('express:app', [
        '../../app'
      ]);
      done();
    }.bind(this));
  });

  it('creates expected files', function (done) {
    var expected = [
      'views/index.ejs',
      'views/layout.ejs',
      'views/404.ejs'
    ];
    var allExpected = expected.concat(basicExpected);
    this.app.options.basic = true;
    this.app.options.viewEngine = 'ejs';
    this.app.options['skip-install'] = true;
    this.app.run({}, function () {
      helpers.assertFiles(allExpected);
      done();
    });
  });
});

var MVCExpected = [
  'Gruntfile.js',
  '.bowerrc',
  '.gitignore',
  'bower.json',
  'app.js',
  'public/img',
  'public/components',
  'public/js',
  'public/css',
  'package.json',
  'config/config.js',
  'config/express.js',
  'app/controllers',
  'app/controllers/home.js',
  'app/models',
  'app/views'
];

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

      this.app = helpers.createGenerator('express:app', [
        '../../app'
      ]);

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

  it('creates expected files', function (done) {
    var expected = [
      'app/views/layout.jade',
      'app/views/404.jade',
      'app/views/index.jade'
    ];
    var allExpected = expected.concat(MVCExpected);

    this.app.options.mvc = true;
    this.app.options.viewEngine = 'jade';
    this.app.options['skip-install'] = true;
    this.app.run({}, function () {
      helpers.assertFiles(allExpected);
      done();
    });
  });
});

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

      this.app = helpers.createGenerator('express:app', [
        '../../app'
      ]);

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

  it('creates expected files', function (done) {
    var expected = [
      'app/views/layout.ejs',
      'app/views/404.ejs',
      'app/views/index.ejs'
    ];
    var allExpected = expected.concat(MVCExpected);

    this.app.options.mvc = true;
    this.app.options.viewEngine = 'ejs';
    this.app.options['skip-install'] = true;
    this.app.run({}, function () {
      helpers.assertFiles(allExpected);
      done();
    });
  });
});
{'fraction_non_alphanumeric': 0.1877772301626417, 'fraction_numerical': 0.003285690816494168, 'mean_word_length': 2.660853878532772, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1319602', 'n_tokens_mistral': 2107, 'n_tokens_neox': 2071, 'n_words': 351}