<commit_before>import path = require('path');
import fs = require('fs');
import 'reflect-metadata';
import { SinonStub } from 'sinon';
import { Container } from 'inversify';
import { Test, TestFixture, AsyncTest, TestCase, AsyncSetup, AsyncTeardown, Expect } from 'alsatian';

import { containerBuilder } from '../lib/di/container';
import TYPES from '../lib/di/types';
import { UserMessager } from '../lib/user-messager';
import { IKernel, ISettingsProvider, IFileSystem, IUserMessager } from '../lib/i';
import { mockMessagerFactory } from '../spec-lib';
import { BaseIntegrationTest } from './base-integration';

/**
 * List of integration tests to write:
 * - X Set directory
 * - Display help
 * - Show project info
 * - Run different kinds of templates
 *   - Simplest, prove that bare bones template.json works
 *   - Various path and content transforms with input.
 *   - Pre- and post-hooks
 *   - Handlers
 */
@TestFixture("Simple Runs Test")
 export class Simple extends BaseIntegrationTest {

    @AsyncTest("Uses correct home and displays a list of templates.")
    public async listsTemplates() {
        let p = this.run(["node", "neoman", "list"])
            .then(this.assertListsTemplates.bind(this));
        await p;
    }

    protected assertListsTemplates() { 
        Expect(this.intercepted).toMatch(/Using: .*neoman\\examples\n/);
        Expect(this.intercepted).toMatch(/\trootdemo - Alternate root folder demo/);
        Expect(this.intercepted).toMatch(/4 template\(s\) found.\n/);
    }

    @AsyncTest("Displays help when appropriate")
    @TestCase(["node", "neoman"])
    @TestCase(["node", "neoman", "help"])
    @TestCase(["node", "neoman", "typoed"])
    public async displaysHelp(args: string[]) {
        let p = this.run(args)
            .then(this.assertHelp.bind(this))
        await p;
    }

    protected assertHelp() {
        Expect(this.intercepted).toMatch(/Manage and run Neoman/);
        Expect(this.intercepted).toMatch(/Usage:\s*\[command\]/);
        Expect(this.intercepted).toMatch(/new/);
        Expect(this.intercepted).toMatch(/list/);<commit_msg>Fixing cross-platform paths in integ test<commit_after>import path = require('path');
import fs = require('fs');
import 'reflect-metadata';
import { SinonStub } from 'sinon';
import { Container } from 'inversify';
import { Test, TestFixture, AsyncTest, TestCase, AsyncSetup, AsyncTeardown, Expect } from 'alsatian';

import { containerBuilder } from '../lib/di/container';
import TYPES from '../lib/di/types';
import { UserMessager } from '../lib/user-messager';
import { IKernel, ISettingsProvider, IFileSystem, IUserMessager } from '../lib/i';
import { mockMessagerFactory } from '../spec-lib';
import { BaseIntegrationTest } from './base-integration';

/**
 * List of integration tests to write:
 * - X Set directory
 * - Display help
 * - Show project info
 * - Run different kinds of templates
 *   - Simplest, prove that bare bones template.json works
 *   - Various path and content transforms with input.
 *   - Pre- and post-hooks
 *   - Handlers
 */
@TestFixture("Simple Runs Test")
 export class Simple extends BaseIntegrationTest {

    @AsyncTest("Uses correct home and displays a list of templates.")
    public async listsTemplates() {
        let p = this.run(["node", "neoman", "list"])
            .then(this.assertListsTemplates.bind(this));
        await p;
    }

    protected assertListsTemplates() { 
        Expect(this.intercepted).toMatch(/Using: .*neoman[\\\/]examples\n/);
        Expect(this.intercepted).toMatch(/\trootdemo - Alternate root folder demo/);
        Expect(this.intercepted).toMatch(/4 template\(s\) found.\n/);
    }

    @AsyncTest("Displays help when appropriate")
    @TestCase(["node", "neoman"])
    @TestCase(["node", "neoman", "help"])
    @TestCase(["node", "neoman", "typoed"])
    public async displaysHelp(args: string[]) {
        let p = this.run(args)
            .then(this.assertHelp.bind(this))
        await p;
    }

    protected assertHelp() {
        Expect(this.intercepted).toMatch(/Manage and run Neoman/);
        Expect(this.intercepted).toMatch(/Usage:\s*\[command\]/);
        Expect(this.intercepted).toMatch(/new/);
        Expect(this.intercepted).toMatch(/list/);
{'fraction_non_alphanumeric': 0.14934148635936031, 'fraction_numerical': 0.00047036688617121356, 'mean_word_length': 3.3442288049029623, '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': '4854119', 'n_tokens_mistral': 1291, 'n_tokens_neox': 1264, 'n_words': 326}