Exemple #1
0
     $console->parseArguments();
     $this->console = $console;
     $suite = new Suite('test', function () {
     });
     $spec = new Spec('testspec', function () {
     }, $suite);
     $this->spec = $spec;
 });
 it('implements the ReporterInterface', function () {
     $reporter = new ListReporter($this->console);
     expect($reporter instanceof ReporterInterface)->toBe(true);
 });
 context('beforeSpec', function () {
     it('increments the spec count', function () {
         $reporter = new ListReporter($this->console);
         $countBefore = $reporter->getSpecCount();
         $reporter->beforeSpec($this->spec);
         $countAfter = $reporter->getSpecCount();
         expect($countAfter)->toEqual($countBefore + 1);
     });
 });
 context('afterSpec', function () {
     it('prints the full spec string in grey if it passed', function () {
         $reporter = new ListReporter($this->console);
         $afterSpec = function () use($reporter) {
             $reporter->afterSpec($this->spec);
         };
         $console = $this->console;
         $title = $this->console->formatter->grey($this->spec);
         expect($afterSpec)->toPrint($title . PHP_EOL);
     });