<commit_before>const assert = require('assert');
const terraform = require('../src/index.js');

describe('terraformVersion', () => {
  it('should return the version of terraform', () => {
    assert.equal(terraform.version(), '0.8.5');
  });
});

describe('normalizeArgName', () => {
  describe('withDash', () => {
    it('should convert `my_option` to `-my-option`', () => {
      assert.equal(terraform.Terraform._normalizeArg('vars_file'), '-vars-file');
    });
  });

  describe('noDash', () => {
    it('should convert `option` to `-option`', () => {
      assert.equal(terraform.Terraform._normalizeArg('option'), '-option');
    });
  });
});

describe('constructOptString', () => {
  describe('noOpts', () => {
    const tf = new terraform.Terraform();
    it('should return an empty object', () => {
      assert.equal(tf._constructOptString({}), '');
    });
  });

  describe('noOptsNoColor', () => {
    const tf = new terraform.Terraform('./', false, true);
    it('should return the ` -no-color` option', () => {
      assert.equal(tf._constructOptString({}), ' -no-color');
    });
  });

  describe('allOpts', () => {
    const tf = new terraform.Terraform();
    const optObj = {
      'force': true,
      'state': 'x.tfstate',
      'var': {'foo': 'bar', 'bah': 'boo'},
      'vars_file': ['y.tfvars', 'z.tfvars']
    };
    const optString = " -force -state=x.tfstate -var 'foo=bar' -var 'bah=boo' -vars-file=y.tfvars -vars-file=z.tfvars"<commit_msg>Add some spacing in tests<commit_after>const assert = require('assert');
const terraform = require('../src/index.js');

describe('terraformVersion', () => {
  it('should return the version of terraform', () => {
    assert.equal(terraform.version(), '0.8.5');
  });
});

describe('normalizeArgName', () => {
  describe('withDash', () => {
    it('should convert `my_option` to `-my-option`', () => {
      assert.equal(terraform.Terraform._normalizeArg('vars_file'), '-vars-file');
    });
  });

  describe('noDash', () => {
    it('should convert `option` to `-option`', () => {
      assert.equal(terraform.Terraform._normalizeArg('option'), '-option');
    });
  });
});

describe('constructOptString', () => {
  describe('noOpts', () => {
    const tf = new terraform.Terraform();

    it('should return an empty object', () => {
      assert.equal(tf._constructOptString({}), '');
    });
  });

  describe('noOptsNoColor', () => {
    const tf = new terraform.Terraform('./', false, true);

    it('should return the ` -no-color` option', () => {
      assert.equal(tf._constructOptString({}), ' -no-color');
    });
  });

  describe('allOpts', () => {
    const tf = new terraform.Terraform();
    const optObj = {
      'force': true,
      'state': 'x.tfstate',
      'var': {'foo': 'bar', 'bah': 'boo'},
      'vars_file': ['y.tfvars', 'z.tfvars']
    };
    const optString = " -force -state=x.tfstate -var 'foo=bar' -var 'bah=boo' -vars-file=y.tfvars -vars-file=z.tfvars"

{'fraction_non_alphanumeric': 0.22996280013527223, 'fraction_numerical': 0.002029083530605343, 'mean_word_length': 3.3887240356083086, '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': '290734', 'n_tokens_mistral': 1011, 'n_tokens_neox': 1021, 'n_words': 177}