<commit_before>'use strict';

var path = require('path');
var expect = require('chai').expect;
var exec = require('child_process').exec;
var execOptions = {
	cwd: path.join(__dirname, '..')
};

describe('Grunt tabs4life', function () {
	this.timeout(5000);
	
	describe('when checking self', function () {
		it('should be lint free', function (done) {
			exec('grunt', execOptions, function (error, stdout) {
				expect(error).to.be.null;
				expect(stdout).to.contain('files lint free.');
				done();
			});
		});
	});
	
	describe('and custom config for', function () {
		describe('nothing', function () {
			it('should be lint free', function (done) {
				exec('grunt tabs4life:testNoConfig', execOptions, function (error, stdout) {
					expect(error).to.be.null;
					expect(stdout).to.contain('files lint free.');
					done();
				});
			});
		});
		
		describe('jscs', function () {
			it('should now find jscs errors', function (done) {
				exec('grunt tabs4life:testJscsCustomConfig', execOptions, function (error, stdout) {
					expect(error).not.to.be.null;
					expect(stdout).to.contain('Illegal trailing whitespace');
					done();
				});
			});
		});
		
		describe('jshint', function () {
			it('should now find jshint errors', function (done) {
				exec('grunt tabs4life:testJshintCustomConfig', execOptions, function (error, stdout) {
					expect(error).not.to.be.null;
					expect(stdout).to.contain('Strings must use doublequote.');
					done();
				});
			});
		});
		
		describe('lintspaces', function () {
			it('should now find lintspace errors', function (done) {
				exec('grunt tabs4life:testLintspacesCustomConfig', execOptions, function (error, stdout) {
					expect(error).not.to.be.null;
					expect(stdout).to.contain('Unexpected trailing spaces found.');
					done();
				});
			});
		});
	});
	
	describe('when used on files that are bad', function () {
		describe('because they fail jscs', function () {
			it('should now find jscs errors', function (done) {
				exec('grunt tabs4life:testJscsBad', execOptions, function (error, stdout) {
					expect(error).not.to.be.null;
					expect(stdout).to.contain('One (or more) spaces required before opening brace for block expressions');
					expect(stdout).to.contain('Missing line feed at file end');
					done();
				});
			});
		});
		
		describe('because they fail jshint', function () {
			it('should now find jshint errors', function (done) {
				exec('grunt tabs4life:testJshintBad', execOptions, function (error, stdout) {
					expect(error).not.to.be.null;
					expect(stdout).to.contain('is defined but never used.');
					done();
				});
			});
		});
		
		describe('because they fail lintspaces', function () {
			it('should now find lintspace errors', function (done) {
				exec('grunt tabs4life:testLintspacesBad', execOptions, function (error, stdout) {
					expect(error).not.to.be.null;
					expect(stdout).to.contain('Unexpected spaces found.');
					done();
				});
			});
		});
		
		describe('because they everything is bad', function () {
			it('should now errors', function (done) {
				exec('grunt tabs4life:testEverythingBad', execOptions, function (error, stdout) {
					expect(error).not.to.be.null;
					expect(stdout).to.contain('code style errors found');
					done();
				});
			});
		});
	});
});
<commit_msg>fix test spec & suite description<commit_after>'use strict';

var path = require('path');
var expect = require('chai').expect;
var exec = require('child_process').exec;
var execOptions = {
	cwd: path.join(__dirname, '..')
};

describe('Grunt tabs4life', function () {
	this.timeout(5000);
	
	describe('when checking self', function () {
		it('should be lint free', function (done) {
			exec('grunt', execOptions, function (error, stdout) {
				expect(error).to.be.null;
				expect(stdout).to.contain('files lint free.');
				done();
			});
		});
	});
	
	describe('and custom config for', function () {
		describe('nothing', function () {
			it('should be lint free', function (done) {
				exec('grunt tabs4life:testNoConfig', execOptions, function (error, stdout) {
					expect(error).to.be.null;
					expect(stdout).to.contain('files lint free.');
					done();
				});
			});
		});
		
		describe('jscs', function () {
			it('should now find jscs errors', function (done) {
				exec('grunt tabs4life:testJscsCustomConfig', execOptions, function (error, stdout) {
					expect(error).not.to.be.null;
					expect(stdout).to.contain('Illegal trailing whitespace');
					done();
				});
			});
		});
		
		describe('jshint', function () {
			it('should now find jshint errors', function (done) {
				exec('grunt tabs4life:testJshintCustomConfig', execOptions, function (error, stdout) {
					expect(error).not.to.be.null;
					expect(stdout).to.contain('Strings must use doublequote.');
					done();
				});
			});
		});
		
		describe('lintspaces', function () {
			it('should now find lintspace errors', function (done) {
				exec('grunt tabs4life:testLintspacesCustomConfig', execOptions, function (error, stdout) {
					expect(error).not.to.be.null;
					expect(stdout).to.contain('Unexpected trailing spaces found.');
					done();
				});
			});
		});
	});
	
	describe('when used on files that are bad', function () {
		describe('because they fail jscs', function () {
			it('should now find jscs errors', function (done) {
				exec('grunt tabs4life:testJscsBad', execOptions, function (error, stdout) {
					expect(error).not.to.be.null;
					expect(stdout).to.contain('One (or more) spaces required before opening brace for block expressions');
					expect(stdout).to.contain('Missing line feed at file end');
					done();
				});
			});
		});
		
		describe('because they fail jshint', function () {
			it('should now find jshint errors', function (done) {
				exec('grunt tabs4life:testJshintBad', execOptions, function (error, stdout) {
					expect(error).not.to.be.null;
					expect(stdout).to.contain('is defined but never used.');
					done();
				});
			});
		});
		
		describe('because they fail lintspaces', function () {
			it('should now find lintspace errors', function (done) {
				exec('grunt tabs4life:testLintspacesBad', execOptions, function (error, stdout) {
					expect(error).not.to.be.null;
					expect(stdout).to.contain('Unexpected spaces found.');
					done();
				});
			});
		});
		
		describe('because everything is bad', function () {
			it('should now report errors', function (done) {
				exec('grunt tabs4life:testEverythingBad', execOptions, function (error, stdout) {
					expect(error).not.to.be.null;
					expect(stdout).to.contain('code style errors found');
					done();
				});
			});
		});
	});
});

{'fraction_non_alphanumeric': 0.1670174383644017, 'fraction_numerical': 0.0039085989176187615, 'mean_word_length': 3.6589635854341735, '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': '5794992', 'n_tokens_mistral': 2574, 'n_tokens_neox': 2055, 'n_words': 486}