<commit_before>'use strict';

var path = require('path');
var tap = require('gulp-tap');
var fs = require('graceful-fs');
var should = require('should');
var rimraf = require('rimraf');
var Assemble = require('..');

var assemble = null;
var actual = __dirname + '/dest-path-actual';

describe('assemble dest-path plugin', function() {
  before (function () {
    assemble = Assemble.create();
  });

  describe('destPath()', function() {
    beforeEach(function (done) {
      rimraf(actual, done);
    });
    afterEach(function (done) {
      rimraf(actual, done);
    });

    describe('when files are run through the pipe', function () {
      it('should keep dest the same before the dest path plugin is run.', function (done) {
        assemble.set('assets', actual + '/assets');
        var instream = assemble.src(path.join(__dirname, 'fixtures/dest-path/*.hbs'));
        var outstream = assemble.dest(actual);

        instream
          .pipe(tap(function (file) {
            should.exist(file);
            should.exist(file.path);
            should.exist(file.contents);
            file.dest.ext.should.equal('.hbs');
            /fixtures\/dest-path\/[cd]\.hbs/.test(file.dest.path).should.be.true;
          }))
          .pipe(outstream);

        outstream.on('error', done);
        outstream.on('end', function () {
          done();
        });

      });

      it('should calculate the correct `assets` property on the file when the dest changes.', function (done) {
        assemble.set('assets', actual + '/assets');
        var instream = assemble.src(path.join(__dirname, 'fixtures/dest-path/*.hbs'));
        var outstream = assemble.dest(actual);
        instream.pipe(outstream);

        outstream.on('error', done);
        outstream.on('data', function (file) {
            should.exist(file);
            should.exist(file.path);
            should.exist(file.contents);
            file.dest.ext.should.equal('.html');
            /dest-path-actual\/[cd]\.html/.test(file.dest.path).should.be.true;
        });<commit_msg>fixes path regex to work on all platforms<commit_after>'use strict';

var path = require('path');
var tap = require('gulp-tap');
var fs = require('graceful-fs');
var should = require('should');
var rimraf = require('rimraf');
var Assemble = require('..');

var assemble = null;
var actual = __dirname + '/dest-path-actual';

describe('assemble dest-path plugin', function() {
  before (function () {
    assemble = Assemble.create();
  });

  describe('destPath()', function() {
    beforeEach(function (done) {
      rimraf(actual, done);
    });
    afterEach(function (done) {
      rimraf(actual, done);
    });

    describe('when files are run through the pipe', function () {
      it('should keep dest the same before the dest path plugin is run.', function (done) {
        assemble.set('assets', actual + '/assets');
        var instream = assemble.src(path.join(__dirname, 'fixtures/dest-path/*.hbs'));
        var outstream = assemble.dest(actual);

        instream
          .pipe(tap(function (file) {
            should.exist(file);
            should.exist(file.path);
            should.exist(file.contents);
            file.dest.ext.should.equal('.hbs');
            /fixtures[\/\\]dest-path[\/\\][cd]\.hbs/.test(file.dest.path).should.be.true;
          }))
          .pipe(outstream);

        outstream.on('error', done);
        outstream.on('end', function () {
          done();
        });

      });

      it('should calculate the correct `assets` property on the file when the dest changes.', function (done) {
        assemble.set('assets', actual + '/assets');
        var instream = assemble.src(path.join(__dirname, 'fixtures/dest-path/*.hbs'));
        var outstream = assemble.dest(actual);
        instream.pipe(outstream);

        outstream.on('error', done);
        outstream.on('data', function (file) {
            should.exist(file);
            should.exist(file.path);
            should.exist(file.contents);
            file.dest.ext.should.equal('.html');
            /dest-path-actual[\/\\][cd]\.html/.test(file.dest.path).should.be.true;
        });
{'fraction_non_alphanumeric': 0.1673076923076923, 'fraction_numerical': 0.0, 'mean_word_length': 2.4849246231155777, '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': '2850491', 'n_tokens_mistral': 1234, 'n_tokens_neox': 1198, 'n_words': 261}