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

var should = require('should'), 
		vinylFile = require('vinyl');

require('mocha');

delete require.cache[require.resolve('../')];

var msbuild = require('../');

describe('gulp-msbuild', function () {

	it('should choose right msbuild executable on unix', function (done) {
		var expectedExecutable = /^xbuild/;
		var execFile = function(cmd) {
			cmd.should.match(expectedExecutable);
			done();
		};

		var stream = msbuild({platform: 'linux', architecture: 'x86', windir: ''}, execFile);
		var fakeFile = new vinylFile({
	    cwd: 'cwd',
	    path: 'path',
	    contents: new Buffer('123')
	  });
	  stream.write(fakeFile);
	  stream.end();
	});

	it('should choose right msbuild executable on windows', function (done) {
		var execFile = function(cmd) {
			cmd.should.match(/^C:\/WINDOWS\/Microsoft.Net\/Framework\/v4.0.30319\/MSBuild.exe/);
			done();
		};

		var stream = msbuild({platform: 'win', architecture: 'x86', windir: 'C:/WINDOWS'}, execFile);
		var fakeFile = new vinylFile({
	    cwd: 'cwd',
	    path: 'path',
	    contents: new Buffer('123')
	  });
	  stream.write(fakeFile);
	  stream.end();
	});

	it('should choose right msbuild executable on windows 64', function (done) {
		var execFile = function(cmd) {
			cmd.should.match(/^C:\/WINDOWS\/Microsoft.Net\/Framework64\/v4.0.30319\/MSBuild.exe/);
			done();
		};

		var stream = msbuild({platform: 'win', architecture: 'x64', windir: 'C:/WINDOWS'}, execFile);
		var fakeFile = new vinylFile({
	    cwd: 'cwd',
	    path: 'path',
	    contents: new Buffer('123')
	  });
	  stream.write(fakeFile);
	  stream.end();
	});

	it('should choose right msbuild executable on windows with .net 3.5', function (done) {
		var execFile = function(cmd) {
			cmd.should.match(/^C:\/WINDOWS\/Microsoft.Net\/Framework\/v3.5\/MSBuild.exe/);
			done();
		};

		var stream = msbuild({platform: 'win', architecture: 'x86', windir: 'C:/WINDOWS', toolsVersion: 3.5}, execFile);
		var fakeFile = new vinylFile({
	    cwd: 'cwd',
	    path: 'path',
	    contents: new Buffer('123')
	  });
	  stream.write(fakeFile);
	  stream.end();
	});

	it('should have right default msbuild arguments', function (done) {
		var execFile = function(cmd) {
			cmd.should.match(/\/nologo/gi);
			cmd.should.match(/\/property:Configuration="Release"/gi);
			cmd.should.match(/\/verbosity:normal/gi);
			cmd.should.match(/\/toolsversion:4.0.30319/gi);
			cmd.should.match(/\/target:Rebuild/gi);
			done();
		};

		var stream = msbuild({}, execFile);
		var fakeFile = new vinylFile({
	    cwd: 'cwd',
	    path: 'path',
	    contents: new Buffer('123')
	  });
	  stream.write(fakeFile);
	  stream.end();
	});<commit_msg>Fixed Tests<commit_after>/*global describe, it*/
'use strict';

var should = require('should'), 
		vinylFile = require('vinyl');

require('mocha');

delete require.cache[require.resolve('../')];

var msbuild = require('../');

describe('gulp-msbuild', function () {

	it('should choose right msbuild executable on unix', function (done) {
		var expectedExecutable = /^xbuild/;
		var execFile = function(cmd) {
			cmd.should.match(expectedExecutable);
			done();
		};

		var stream = msbuild({platform: 'linux', architecture: 'x86', windir: ''}, execFile);
		var fakeFile = new vinylFile({
	    cwd: 'cwd',
	    path: 'path',
	    contents: new Buffer('123')
	  });
	  stream.write(fakeFile);
	  stream.end();
	});

	it('should choose right msbuild executable on windows', function (done) {
		var execFile = function(cmd) {
			cmd.should.match(/^C:\/WINDOWS\/Microsoft.Net\/Framework\/v4.0.30319\/MSBuild.exe/);
			done();
		};

		var stream = msbuild({platform: 'win', architecture: 'x86', windir: 'C:/WINDOWS'}, execFile);
		var fakeFile = new vinylFile({
	    cwd: 'cwd',
	    path: 'path',
	    contents: new Buffer('123')
	  });
	  stream.write(fakeFile);
	  stream.end();
	});

	it('should choose right msbuild executable on windows 64', function (done) {
		var execFile = function(cmd) {
			cmd.should.match(/^C:\/WINDOWS\/Microsoft.Net\/Framework64\/v4.0.30319\/MSBuild.exe/);
			done();
		};

		var stream = msbuild({platform: 'win', architecture: 'x64', windir: 'C:/WINDOWS'}, execFile);
		var fakeFile = new vinylFile({
	    cwd: 'cwd',
	    path: 'path',
	    contents: new Buffer('123')
	  });
	  stream.write(fakeFile);
	  stream.end();
	});

	it('should choose right msbuild executable on windows with .net 3.5', function (done) {
		var execFile = function(cmd) {
			cmd.should.match(/^C:\/WINDOWS\/Microsoft.Net\/Framework\/v3.5\/MSBuild.exe/);
			done();
		};

		var stream = msbuild({platform: 'win', architecture: 'x86', windir: 'C:/WINDOWS', toolsVersion: 3.5}, execFile);
		var fakeFile = new vinylFile({
	    cwd: 'cwd',
	    path: 'path',
	    contents: new Buffer('123')
	  });
	  stream.write(fakeFile);
	  stream.end();
	});

	it('should have right default msbuild arguments', function (done) {
		var execFile = function(cmd) {
			cmd.should.match(/\/nologo/gi);
			cmd.should.match(/\/property:Configuration="Release"/gi);
			cmd.should.match(/\/verbosity:normal/gi);
			cmd.should.match(/\/toolsversion:4.0/gi);
			cmd.should.match(/\/target:Rebuild/gi);
			done();
		};

		var stream = msbuild({}, execFile);
		var fakeFile = new vinylFile({
	    cwd: 'cwd',
	    path: 'path',
	    contents: new Buffer('123')
	  });
	  stream.write(fakeFile);
	  stream.end();
	});
{'fraction_non_alphanumeric': 0.18847294292068198, 'fraction_numerical': 0.019088213491475166, 'mean_word_length': 3.508771929824561, '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': '3250376', 'n_tokens_mistral': 2106, 'n_tokens_neox': 1808, 'n_words': 409}