<commit_before>

  describe 'Default Options', ->

    ###*
     * Global Variables
    ###
    rootPath             = "../../../../../../.."
    distPath             = "#{rootPath}/dist"
    basebuildNodeModules = "#{rootPath}/node_modules"

    ###*
     * Imports
    ###
    defaultOptions = require("#{distPath}/defaults")()
    _              = defaultOptions.plugins.lodash

    sinon              = require 'sinon'
    chai               = require 'chai'
    assert             = chai.assert
    expect             = chai.expect


    ###*
     * Tests
    ###
    describe 'Provides a default error handler... ', ->
      beepStup = null
      logStub  = null

      beforeEach ->
        logStub  = defaultOptions.plugins.util.log  = sinon.stub()
        beepStup = defaultOptions.plugins.util.beep = sinon.stub()

      afterEach ->
        logStub.reset()
        beepStup.reset()


      it 'Returns a function when invoked to be a callback on tasks errors', ->
        assert.isFunction defaultOptions.errorHandler('TitleX')

      it 'Uses a custom title to track the error', ->
        cleanCustomTitle  = 'MycleanCustomTitle'
        redCustomTitle    = '\u001b[31m[' + cleanCustomTitle + ']\u001b[39m'
        errorMessage      = 'ErrorXPTO'
        
        errorHandler = defaultOptions.errorHandler(cleanCustomTitle)
        
        errorHandler(errorMessage)

        assert.isTrue logStub.calledOnce
        assert.isTrue logStub.calledWith(redCustomTitle, errorMessage)

      it 'Beeps the terminal to alert the developer', ->
        
        defaultOptions.errorHandler('whatever')('error')
        defaultOptions.plugins.util.log  = sinon.stub()
        

        assert.isTrue beepStup.called

      it 'Emits end of the stream when invoked', ->
        @emit = () ->
        sinon.stub(@, 'emit')

        errorHandler = defaultOptions.errorHandler('whatever')
        errorHandler.apply(@, ['error'])

        assert.isTrue @emit.calledWith('end')
        @emit.reset()

      
        

      

    describe 'Provides node plugins to use as option...', ->

      it 'Being an object as API', -> 
        expect(defaultOptions.plugins).to.be.a('object')

      it 'Contains all gulp plugins in basebuild (gulp-* pattern loaded for gulp-load-plugins)', ->
        gulpPlugins = [
          "angularFilesort"
          "angularTemplatecache"
          "cjsx"
          "coffee"
          "coffeelint"
          "concat"
          "csso"
          "filter"
          "flatten"
          "if"
          "inject"
          "jshint"
          "minifyHtml"
          "ngAnnotate"
          "protractor"
          "rename"
          "replace"
          "rev"
          "revReplace"
          "sass"
          "size"
          "sourcemaps"
          "uglify"
          "useref"
          "util"
          "watch"
        ]

        for plugin in gulpPlugins then expect(defaultOptions.plugins).to.have.property(plugin)
        

      it 'Contains all third-party plugins loaded in basebuild', ->
        thirdPartyPlugins = [
          "browserSync"
          "browserSyncSpa"
          "concatStream"
          "del"
          "httpProxy"
          "jshintStylish"
          "lodash"
          "mainBowerFiles"
          "mergeStream"
          "protractor"
          "requireDir"
          "shelljs"
          "uglifySaveLicense"
          "wiredep"
          "chalk"
        ]

        for plugin in thirdPartyPlugins then expect(defaultOptions.plugins).to.have.property(plugin)<commit_msg>[Defaults] #18 - Avoid _results created by<commit_after>

  describe 'Default Options', ->

    ###*
     * Global Variables
    ###
    rootPath             = "../../../../../../.."
    distPath             = "#{rootPath}/dist"
    basebuildNodeModules = "#{rootPath}/node_modules"

    ###*
     * Imports
    ###
    defaultOptions = require("#{distPath}/defaults")()
    _              = defaultOptions.plugins.lodash

    sinon              = require 'sinon'
    chai               = require 'chai'
    assert             = chai.assert
    expect             = chai.expect


    ###*
     * Tests
    ###
    describe 'Provides a default error handler... ', ->
      beepStup = null
      logStub  = null

      beforeEach ->
        logStub  = defaultOptions.plugins.util.log  = sinon.stub()
        beepStup = defaultOptions.plugins.util.beep = sinon.stub()

      afterEach ->
        logStub.reset()
        beepStup.reset()


      it 'Returns a function when invoked to be a callback on tasks errors', ->
        assert.isFunction defaultOptions.errorHandler('TitleX')

      it 'Uses a custom title to track the error', ->
        cleanCustomTitle  = 'MycleanCustomTitle'
        redCustomTitle    = '\u001b[31m[' + cleanCustomTitle + ']\u001b[39m'
        errorMessage      = 'ErrorXPTO'
        
        errorHandler = defaultOptions.errorHandler(cleanCustomTitle)
        
        errorHandler(errorMessage)

        assert.isTrue logStub.calledOnce
        assert.isTrue logStub.calledWith(redCustomTitle, errorMessage)

      it 'Beeps the terminal to alert the developer', ->
        
        defaultOptions.errorHandler('whatever')('error')
        defaultOptions.plugins.util.log  = sinon.stub()
        

        assert.isTrue beepStup.called

      it 'Emits end of the stream when invoked', ->
        @emit = () ->
        sinon.stub(@, 'emit')

        errorHandler = defaultOptions.errorHandler('whatever')
        errorHandler.apply(@, ['error'])

        assert.isTrue @emit.calledWith('end')
        @emit.reset()

      
        

      

    describe 'Provides node plugins to use as option...', ->

      it 'Being an object as API', -> 
        expect(defaultOptions.plugins).to.be.a('object')

      it 'Contains all gulp plugins in basebuild (gulp-* pattern loaded for gulp-load-plugins)', ->
        gulpPlugins = [
          "angularFilesort"
          "angularTemplatecache"
          "cjsx"
          "coffee"
          "coffeelint"
          "concat"
          "csso"
          "filter"
          "flatten"
          "if"
          "inject"
          "jshint"
          "minifyHtml"
          "ngAnnotate"
          "protractor"
          "rename"
          "replace"
          "rev"
          "revReplace"
          "sass"
          "size"
          "sourcemaps"
          "uglify"
          "useref"
          "util"
          "watch"
        ]

        for plugin in gulpPlugins then expect(defaultOptions.plugins).to.have.property(plugin)
        return
        

      it 'Contains all third-party plugins loaded in basebuild', ->
        thirdPartyPlugins = [
          "browserSync"
          "browserSyncSpa"
          "concatStream"
          "del"
          "httpProxy"
          "jshintStylish"
          "lodash"
          "mainBowerFiles"
          "mergeStream"
          "protractor"
          "requireDir"
          "shelljs"
          "uglifySaveLicense"
          "wiredep"
          "chalk"
        ]

        for plugin in thirdPartyPlugins then expect(defaultOptions.plugins).to.have.property(plugin)
        return

{'fraction_non_alphanumeric': 0.10995207217366788, 'fraction_numerical': 0.0031012122920778123, 'mean_word_length': 1.6287513894034829, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, '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': '5994816', 'n_tokens_mistral': 2056, 'n_tokens_neox': 1981, 'n_words': 420}