<commit_before>'use strict';
const expect = require('chai').expect;
const sinon = require('sinon');
const sinonTest = require('sinon-test')(sinon, {useFakeTimers: false});
const Faker = require('../../src/faker');
const data = require('../../data/company.json');

describe('Company', () => {
  describe('#name', () => {
    it('should return a name', sinonTest(function() {
      this.stub(Faker.Random, 'element').withArgs(data['names']).returns('name');
      expect(Faker.Company.name()).to.eql('name');
    }));
  });

  describe('#suffix', () => {
    it('should return a suffix', sinonTest(function() {
      this.stub(Faker.Random, 'element').withArgs(data['suffixes']).returns('suffix');
      expect(Faker.Company.suffix()).to.eql('suffix');
    }));
  });

  describe('#catchPhrase', () => {
    it('should return a catchPhrase', sinonTest(function() {
      const randomStub = this.stub(Faker.Random, 'element');
      randomStub.withArgs(data['buzzwords'][0]).returns('b1');
      randomStub.withArgs(data['buzzwords'][1]).returns('b2');
      randomStub.withArgs(data['buzzwords'][2]).returns('b3');
      expect(Faker.Company.catchPhrase()).to.eql('b1 b2 b3');
    }));
  });<commit_msg>Added a test to make sure that we are processing the name through the fake faker.<commit_after>'use strict';
const expect = require('chai').expect;
const sinon = require('sinon');
const sinonTest = require('sinon-test')(sinon, {useFakeTimers: false});
const Faker = require('../../src/faker');
const data = require('../../data/company.json');

describe('Company', () => {
  describe('#name', () => {
    it('should return a name', sinonTest(function() {
      this.stub(Faker.Random, 'element').withArgs(data['names']).returns('name');
      expect(Faker.Company.name()).to.eql('name');
    }));

    it('should run the name through the fake faker', sinonTest(function() {
      this.stub(Faker.Random, 'element').withArgs(data['names']).returns('{Name.lastName} {suffix}');
      this.stub(Faker.Name, 'lastName').returns('Hirthe');
      this.stub(Faker.Company, 'suffix').returns('Inc');
      expect(Faker.Company.name()).to.eql('Hirthe Inc');
    }));
  });

  describe('#suffix', () => {
    it('should return a suffix', sinonTest(function() {
      this.stub(Faker.Random, 'element').withArgs(data['suffixes']).returns('suffix');
      expect(Faker.Company.suffix()).to.eql('suffix');
    }));
  });

  describe('#catchPhrase', () => {
    it('should return a catchPhrase', sinonTest(function() {
      const randomStub = this.stub(Faker.Random, 'element');
      randomStub.withArgs(data['buzzwords'][0]).returns('b1');
      randomStub.withArgs(data['buzzwords'][1]).returns('b2');
      randomStub.withArgs(data['buzzwords'][2]).returns('b3');
      expect(Faker.Company.catchPhrase()).to.eql('b1 b2 b3');
    }));
  });
{'fraction_non_alphanumeric': 0.22218297421405864, 'fraction_numerical': 0.006358177322500883, 'mean_word_length': 4.435700575815739, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '634503', 'n_tokens_mistral': 929, 'n_tokens_neox': 932, 'n_words': 141}