<commit_before>chai = require 'chai'
sinon = require 'sinon'
chai.use require 'sinon-chai'
expect = chai.expect
require '../test_helper'
Mycha = require '../../lib/mycha'
FileConfiguration = require '../../lib/configuration/file_configuration'


describe 'FileConfiguration', ->

  describe 'constructor', ->

    context 'no user options given', ->

      beforeEach ->
        @file_configuration = new FileConfiguration
          test_dir: 'test_data/subdirectories'
          default_files: Mycha.default_files
          files: []

      it 'includes the given default file', ->
        expect(@file_configuration.files).to.include Mycha.default_files[0]

      it 'includes all files in the "test" directory', ->
        expect(@result).to.include_test_file 'two_tests', 'one_test.coffee'
        expect(@result).to.include_test_file 'two_tests', 'two_test.coffee'


    context 'custom test directory given', ->

      beforeEach ->
        @file_configuration = new FileConfiguration
          test_dir: 'test_data/subdirectories'
          default_files: Mycha.default_files
          files: []

      it 'includes the given default file', ->
        expect(@file_configuration.files).to.include Mycha.default_files[0]

      it 'includes all files in the "test" directory', ->
        expect(@result).to.include_test_file 'custom_test_directory', 'one_spec.coffee'
        expect(@result).to.include_test_file 'custom_test_directory', 'two_spec.coffee'


    context 'single test file name given by the user', ->

      beforeEach ->
        # @file_configuration = new FileConfiguration
        #   test_dir: 'test/test_data'
        #   default_files: Mycha.default_files
        #   files: ['run', '']

      it 'includes the Mycha helper file'

      it 'only runs the given test file'


  describe 'to_args', ->

    beforeEach ->
      file_configuration = new FileConfiguration
        test_dir: 'test_data/subdirectories/'
        default_files: Mycha.default_files
        files: []
      @result = file_configuration.to_args()

    it 'loads the Mycha helper first', ->
      expect(@result[0]).to.equal "#{process.cwd()}/lib/test_helper.coffee"

    it 'provides all test files', ->
      expect(@result).to.include_test_file 'two_tests', 'one_test.coffee'
      expect(@result).to.include_test_file 'two_tests', 'two_test.coffee'

<commit_msg>Check for the presence of all default files in the file output<commit_after>chai = require 'chai'
sinon = require 'sinon'
chai.use require 'sinon-chai'
expect = chai.expect
require '../test_helper'
Mycha = require '../../lib/mycha'
FileConfiguration = require '../../lib/configuration/file_configuration'


describe 'FileConfiguration', ->

  describe 'constructor', ->

    context 'no user options given', ->

      beforeEach ->
        @file_configuration = new FileConfiguration
          test_dir: 'test_data/subdirectories'
          default_files: Mycha.default_files
          files: []

      it 'includes the given default file', ->
        for default_file in Mycha.default_files
          expect(@result).to.include(default_file)

      it 'includes all files in the "test" directory', ->
        expect(@result).to.include_test_file 'two_tests', 'one_test.coffee'
        expect(@result).to.include_test_file 'two_tests', 'two_test.coffee'


    context 'custom test directory given', ->

      beforeEach ->
        @file_configuration = new FileConfiguration
          test_dir: 'test_data/subdirectories'
          default_files: Mycha.default_files
          files: []

      it 'includes the given default file', ->
        for default_file in Mycha.default_files
          expect(@result).to.include(default_file)

      it 'includes all files in the "test" directory', ->
        expect(@result).to.include_test_file 'custom_test_directory', 'one_spec.coffee'
        expect(@result).to.include_test_file 'custom_test_directory', 'two_spec.coffee'


    context 'single test file name given by the user', ->

      beforeEach ->
        # @file_configuration = new FileConfiguration
        #   test_dir: 'test/test_data'
        #   default_files: Mycha.default_files
        #   files: ['run', '']

      it 'includes the given default file', ->
        for default_file in Mycha.default_files
          expect(@result).to.include(default_file)

      it 'only runs the given test file'


  describe 'to_args', ->

    beforeEach ->
      file_configuration = new FileConfiguration
        test_dir: 'test_data/subdirectories/'
        default_files: Mycha.default_files
        files: []
      @result = file_configuration.to_args()

    it 'loads the Mycha helper first', ->
      expect(@result[0]).to.equal "#{process.cwd()}/lib/test_helper.coffee"

    it 'provides all test files', ->
      expect(@result).to.include_test_file 'two_tests', 'one_test.coffee'
      expect(@result).to.include_test_file 'two_tests', 'two_test.coffee'


{'fraction_non_alphanumeric': 0.11426831743454435, 'fraction_numerical': 0.0008118530545971179, 'mean_word_length': 2.9424, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 36, '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': '2361731', 'n_tokens_mistral': 1457, 'n_tokens_neox': 1405, 'n_words': 340}