$console->parseArguments();
expect($console->getPaths())->toEqual(['./']);
});
});
context('getReporterClass', function () {
it('returns DotReporter by default', function () {
$console = new Console([], 'php://output');
$console->parseArguments();
$expectedClass = 'pho\\Reporter\\DotReporter';
expect($console->getReporterClass())->toEqual($expectedClass);
});
it('returns a valid reporter specified in the args', function () {
$console = new Console(['-r', 'spec'], 'php://output');
$console->parseArguments();
$expectedClass = 'pho\\Reporter\\SpecReporter';
expect($console->getReporterClass())->toEqual($expectedClass);
});
context('when reporter not found', function () {
before(function () {
$this->console = new Console(['-r', 'unkown'], 'php://output');
$this->console->parseArguments();
});
it('throw pho\\Exception\\ReporterNotFoundException exception', function () {
expect(function () {
$this->console->getReporterClass();
})->toThrow('pho\\Exception\\ReporterNotFoundException');
});
});
});
context('write', function () {
it('prints the text to the terminal', function () {