<commit_before>should = require 'should'
environment = require './shared/environment'
Impromptu = require '../lib/impromptu'
path = require 'path'
exec = require('child_process').exec


describe 'Config File', ->
  impromptu = new Impromptu

  after (done) ->
    tempDir = path.dirname impromptu.path.compiled
    exec "rm -rf #{tempDir}", ->
      done()

  tu = null

  it 'should create an instance of Impromptu', ->
    tu = new Impromptu()
    should.exist tu

  it 'should load the config file', ->
    impromptu.load()
    impromptu.prompt._orderedSections.length.should.be.ok

  it 'should build the prompt', (done) ->
    impromptu.prompt.build (err, prompt) ->
      prompt.should.equal '\u001b[42m\u001b[37m user@host \u001b[0m\u001b[44m\u001b[37m ~/path/to/impromptu \u001b[0m'
      done()<commit_msg>Use consistent escape codes in sample prompt test.<commit_after>should = require 'should'
environment = require './shared/environment'
Impromptu = require '../lib/impromptu'
path = require 'path'
exec = require('child_process').exec


describe 'Config File', ->
  impromptu = new Impromptu

  after (done) ->
    tempDir = path.dirname impromptu.path.compiled
    exec "rm -rf #{tempDir}", ->
      done()

  tu = null

  it 'should create an instance of Impromptu', ->
    tu = new Impromptu()
    should.exist tu

  it 'should load the config file', ->
    impromptu.load()
    impromptu.prompt._orderedSections.length.should.be.ok

  it 'should build the prompt', (done) ->
    impromptu.prompt.build (err, prompt) ->
      prompt.should.equal '\x1b[42m\x1b[37m user@host \x1b[0m\x1b[44m\x1b[37m ~/path/to/impromptu \x1b[0m'
      done()
{'fraction_non_alphanumeric': 0.13836858006042296, 'fraction_numerical': 0.026586102719033233, 'mean_word_length': 3.3012987012987014, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '2189655', 'n_tokens_mistral': 620, 'n_tokens_neox': 579, 'n_words': 142}