<commit_before>chai = require 'chai'
sinon = require 'sinon'
Util = require 'util'
OptionsManager = require '../src/options-manager'
SharedObjects = require '../src/shared-objects'

expect = chai.expect
chai.should()

module.exports = run: ->

	sharedObjects = null
	optionsManager = null

	beforeEach ->
		optionsManager = new OptionsManager
		sharedObjects = new SharedObjects


	describe '@constructor', ->

		it 'should have created an instance of the SharedObjects', ->
			expect(sharedObjects).to.be.an 'object'
			expect(sharedObjects).to.be.an.instanceof SharedObjects


		it 'should have registered a shared logs object', ->
			sharedLogs = sharedObjects.logs()
			expect(sharedLogs).to.be.an 'object'


	describe '@returnOptionsAndWarning', ->

		it 'should be a function', ->
			expect(optionsManager.returnOptionsAndWarning).to.be.a 'function'

		it 'should push new warnings', ->
			options = 'preserveRoot'
			warnings = ["Wrong preserveRoot options -> default ones will be used instead"]
			optionsManager.returnOptionsAndWarning options
			expect(optionsManager.shared.logs.warnings).to.deep.members warnings

		it 'should return defaults options', ->
			options = 'preserveRoot'
			mock = true
			expect(optionsManager.returnOptionsAndWarning(options)).to.equal mock


	describe '@checkArrayMatch', ->

		it 'should be a function', ->
			expect(optionsManager.checkArrayMatch).to.be.a 'function'<commit_msg>Updated option manager tests to check for options registration through constructor<commit_after>chai = require 'chai'
sinon = require 'sinon'
Util = require 'util'
OptionsManager = require '../src/options-manager'
SharedObjects = require '../src/shared-objects'

expect = chai.expect
chai.should()

module.exports = run: ->

	sharedObjects = null
	optionsManager = null

	beforeEach ->
		optionsManager = new OptionsManager
		sharedObjects = new SharedObjects


	describe '@constructor', ->

		it 'should have created an instance of the SharedObjects', ->
			expect(sharedObjects).to.be.an 'object'
			expect(sharedObjects).to.be.an.instanceof SharedObjects


		it 'should have registered a shared logs object', ->
			sharedLogs = sharedObjects.logs()
			expect(sharedLogs).to.be.an 'object'

		it 'should have registered a shared options object', ->
			sharedOptions = sharedObjects.defaultOptions()
			expect(sharedOptions).to.be.an 'object'


	describe '@returnOptionsAndWarning', ->

		it 'should be a function', ->
			expect(optionsManager.returnOptionsAndWarning).to.be.a 'function'

		it 'should push new warnings', ->
			options = 'preserveRoot'
			warnings = ["Wrong preserveRoot options -> default ones will be used instead"]
			optionsManager.returnOptionsAndWarning options
			expect(optionsManager.shared.logs.warnings).to.deep.members warnings

		it 'should return defaults options', ->
			options = 'preserveRoot'
			mock = true
			expect(optionsManager.returnOptionsAndWarning(options)).to.equal mock


	describe '@checkArrayMatch', ->

		it 'should be a function', ->
			expect(optionsManager.checkArrayMatch).to.be.a 'function'
{'fraction_non_alphanumeric': 0.11078527207559466, 'fraction_numerical': 0.0, 'mean_word_length': 4.357766143106457, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 28, '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': '1761711', 'n_tokens_mistral': 954, 'n_tokens_neox': 835, 'n_words': 237}