Пример #1
0
 /**
  * Ran after an individual spec. May be used to display the results of that
  * particular spec.
  *
  * @param Spec $spec The spec after which to run this method
  */
 public function afterSpec(Spec $spec)
 {
     $leftPad = str_repeat(' ', self::TAB_SIZE * $this->depth);
     if ($spec->getResult() === Spec::FAILED) {
         $this->failedSpecs[] = $spec;
         $title = $this->formatter->red($spec->getTitle());
     } else {
         if ($spec->getResult() === Spec::INCOMPLETE) {
             $this->incompleteSpecs[] = $spec;
             $title = $this->formatter->cyan($spec->getTitle());
         } else {
             $title = $this->formatter->grey($spec->getTitle());
         }
     }
     $this->console->writeLn($leftPad . $title);
 }
Пример #2
0
 /**
  * Ran after an individual spec. May be used to display the results of that
  * particular spec.
  *
  * @param Spec $spec The spec after which to run this method
  */
 public function afterSpec(Spec $spec)
 {
     $leftPad = str_repeat(' ', self::TAB_SIZE * $this->depth);
     if ($spec->isFailed()) {
         $this->failedSpecs[] = $spec;
         $title = $this->formatter->red($spec->getTitle());
     } else {
         if ($spec->isIncomplete()) {
             $this->incompleteSpecs[] = $spec;
             $title = $this->formatter->cyan($spec->getTitle());
         } else {
             if ($spec->isPending()) {
                 $this->pendingSpecs[] = $spec;
                 $title = $this->formatter->yellow($spec->getTitle());
             } else {
                 $title = $this->formatter->grey($spec->getTitle());
             }
         }
     }
     $this->console->writeLn($leftPad . $title);
 }