<commit_before>/*globals describe, it*/
const assert = require('assert');
const TemplateGenerator = require('../lib/cmds/template_generator');

describe('TemplateGenerator', function () {
  describe('getExternalProject', function () {
    let templateGenerator;

    before(() => {
      templateGenerator = new TemplateGenerator();
    });

    describe('with github link', function () {

      it('return correct zip filename for https link', function () {
        let result = templateGenerator.getExternalProject("https://github.com/embark-framework/embark");
        assert.strictEqual(result.url, "https://github.com/embark-framework/embark/archive/master.zip");
        assert.strictEqual(result.filePath, ".embark/templates/embark-framework/embark/archive.zip");
      });

      it('return correct zip filename for http link', function () {
        let result = templateGenerator.getExternalProject("http://github.com/embark-framework/embark");
        assert.strictEqual(result.url, "http://github.com/embark-framework/embark/archive/master.zip");
        assert.strictEqual(result.filePath, ".embark/templates/embark-framework/embark/archive.zip");
      });

      it('return correct zip filename without protocol specified ', function () {
        let result = templateGenerator.getExternalProject("github.com/embark-framework/embark");
        assert.strictEqual(result.url, "https://github.com/embark-framework/embark/archive/master.zip");
        assert.strictEqual(result.filePath, ".embark/templates/embark-framework/embark/archive.zip");
      });

      it('return correct zip filename without protocol specified ', function () {
        let result = templateGenerator.getExternalProject("github.com/embark-framework/embark");
        assert.strictEqual(result.url, "https://github.com/embark-framework/embark/archive/master.zip");
        assert.strictEqual(result.filePath, ".embark/templates/embark-framework/embark/archive.zip");
      });

      it('return correct zip filename with just username/repo specified', function () {
        let result = templateGenerator.getExternalProject("embark-framework/embark");
        assert.strictEqual(result.url, "https://github.com/embark-framework/embark/archive/master.zip");
        assert.strictEqual(result.filePath, ".embark/templates/embark-framework/embark/archive.zip");
      });

      it('return correct zip filename with just embark template specified', function () {
        let result = templateGenerator.getExternalProject("react");
        assert.strictEqual(result.url, "https://github.com/embark-framework/embark-react-template/archive/master.zip");
        assert.strictEqual(result.filePath, ".embark/templates/embark-framework/embark-react-template/archive.zip");
      });

    });<commit_msg>update test so it plays nice with windows<commit_after>/*globals describe, it*/
const assert = require('assert');
const TemplateGenerator = require('../lib/cmds/template_generator');

describe('TemplateGenerator', function () {
  describe('getExternalProject', function () {
    let templateGenerator;

    before(() => {
      templateGenerator = new TemplateGenerator();
    });

    describe('with github link', function () {

      it('return correct zip filename for https link', function () {
        let result = templateGenerator.getExternalProject("https://github.com/embark-framework/embark");
        assert.strictEqual(result.url, "https://github.com/embark-framework/embark/archive/master.zip");
        assert.strictEqual(result.filePath.replace(/\\/g,'/'), ".embark/templates/embark-framework/embark/archive.zip");
      });

      it('return correct zip filename for http link', function () {
        let result = templateGenerator.getExternalProject("http://github.com/embark-framework/embark");
        assert.strictEqual(result.url, "http://github.com/embark-framework/embark/archive/master.zip");
        assert.strictEqual(result.filePath.replace(/\\/g,'/'), ".embark/templates/embark-framework/embark/archive.zip");
      });

      it('return correct zip filename without protocol specified ', function () {
        let result = templateGenerator.getExternalProject("github.com/embark-framework/embark");
        assert.strictEqual(result.url, "https://github.com/embark-framework/embark/archive/master.zip");
        assert.strictEqual(result.filePath.replace(/\\/g,'/'), ".embark/templates/embark-framework/embark/archive.zip");
      });

      it('return correct zip filename without protocol specified ', function () {
        let result = templateGenerator.getExternalProject("github.com/embark-framework/embark");
        assert.strictEqual(result.url, "https://github.com/embark-framework/embark/archive/master.zip");
        assert.strictEqual(result.filePath.replace(/\\/g,'/'), ".embark/templates/embark-framework/embark/archive.zip");
      });

      it('return correct zip filename with just username/repo specified', function () {
        let result = templateGenerator.getExternalProject("embark-framework/embark");
        assert.strictEqual(result.url, "https://github.com/embark-framework/embark/archive/master.zip");
        assert.strictEqual(result.filePath.replace(/\\/g,'/'), ".embark/templates/embark-framework/embark/archive.zip");
      });

      it('return correct zip filename with just embark template specified', function () {
        let result = templateGenerator.getExternalProject("react");
        assert.strictEqual(result.url, "https://github.com/embark-framework/embark-react-template/archive/master.zip");
        assert.strictEqual(result.filePath.replace(/\\/g,'/'), ".embark/templates/embark-framework/embark-react-template/archive.zip");
      });

    });
{'fraction_non_alphanumeric': 0.14896600070101648, 'fraction_numerical': 0.0, 'mean_word_length': 3.8364406779661016, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 12, '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': '4846021', 'n_tokens_mistral': 1532, 'n_tokens_neox': 1507, 'n_words': 239}