<commit_before><?php

use expect\Configuration;
use Assert\Assertion;

describe('Configuration', function() {
    beforeEach(function() {
        $this->config = Configuration::loadFromFile(__DIR__ . '/fixtures/config.toml');
    });
    describe('#loadFromFile', function() {
        it('return Configuration instance', function() {
            Assertion::isInstanceOf($this->config, 'expect\Configuration');
        });
    });
    describe('#getResultReporter', function() {
        it('return expect\ResultReporter', function() {
            Assertion::isInstanceOf($this->config->getResultReporter(), 'expect\ResultReporter');
        });
    });
    describe('#getMatcherPackages', function() {
        beforeEach(function() {
            $this->matcherPackages = $this->config->getMatcherPackages();
        });
        it('return matcher packages', function() {
            Assertion::isArray($this->matcherPackages);
        });
        describe('when have one package', function() {
            it('return one package', function() {
                Assertion::count($this->matcherPackages, 1);
            });
        });
    });
});<commit_msg>Add exception spec<commit_after><?php

use expect\Configuration;
use expect\config\ConfigurationFileNotFoundException;
use Assert\Assertion;


describe('Configuration', function() {
    beforeEach(function() {
        $this->config = Configuration::loadFromFile(__DIR__ . '/fixtures/config.toml');
    });
    describe('#loadFromFile', function() {
        it('return Configuration instance', function() {
            Assertion::isInstanceOf($this->config, 'expect\Configuration');
        });
        context('when config file not found', function() {
            it('throw ConfigurationFileNotFoundException', function() {
                $throwExpection = false;

                try {
                    Configuration::loadFromFile(__DIR__ . '/fixtures/not_found_config.toml');
                } catch (ConfigurationFileNotFoundException $exception) {
                    $throwExpection = true;
                }
                Assertion::true($throwExpection);
            });
        });
    });
    describe('#getResultReporter', function() {
        it('return expect\ResultReporter', function() {
            Assertion::isInstanceOf($this->config->getResultReporter(), 'expect\ResultReporter');
        });
    });
    describe('#getMatcherPackages', function() {
        beforeEach(function() {
            $this->matcherPackages = $this->config->getMatcherPackages();
        });
        it('return matcher packages', function() {
            Assertion::isArray($this->matcherPackages);
        });
        context('when have one package', function() {
            it('return one package', function() {
                Assertion::count($this->matcherPackages, 1);
            });
        });
    });
});
{'fraction_non_alphanumeric': 0.15006963788300837, 'fraction_numerical': 0.0006963788300835655, 'mean_word_length': 2.582294264339152, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '4411422', 'n_tokens_mistral': 720, 'n_tokens_neox': 708, 'n_words': 118}