Пример #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)
 {
     if ($spec->isFailed()) {
         $this->failedSpecs[] = $spec;
         $this->console->writeLn("##teamcity[testFailed name='" . $spec . "' message='" . $this->formatter->red('failed') . "' details='" . str_replace("\n", ' ', $spec->exception) . "']");
     } else {
         if ($spec->isIncomplete()) {
             $this->incompleteSpecs[] = $spec;
         } else {
             if ($spec->isPending()) {
                 $this->pendingSpecs[] = $spec;
             }
         }
     }
     $this->console->writeLn("##teamcity[testFinished name='" . $spec . "']");
 }
Пример #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);
 }
Пример #3
0
 /**
  * Ran after an individual spec.
  *
  * @param Spec $spec The spec after which to run this method
  */
 public function afterSpec(Spec $spec)
 {
     $this->lineLength += 1;
     if ($spec->isFailed()) {
         $this->failedSpecs[] = $spec;
         $failure = $this->formatter->red('F');
         $this->console->write($failure);
     } else {
         if ($spec->isIncomplete()) {
             $this->incompleteSpecs[] = $spec;
             $incomplete = $this->formatter->cyan('I');
             $this->console->write($incomplete);
         } else {
             if ($spec->isPending()) {
                 $this->pendingSpecs[] = $spec;
                 $pending = $this->formatter->yellow('P');
                 $this->console->write($pending);
             } else {
                 $this->console->write('.');
             }
         }
     }
 }
Пример #4
0
            $spec->run();
            expect($spec->isFailed())->toBe(false);
        });
    });
    describe('isIncomplete', function () {
        it('returns true when the spec is incomplete', function () {
            $spec = new Spec('SpecTitle', null, $this->suite);
            $spec->run();
            expect($spec->isIncomplete())->toBe(true);
        });
        it('returns false when the spec is not incomplete', function () {
            $spec = new Spec('SpecTitle', function () {
            }, $this->suite);
            $spec->run();
            expect($spec->isIncomplete())->toBe(false);
        });
    });
    describe('isPending', function () {
        it('returns true when the spec is pending', function () {
            $spec = new Spec('SpecTitle', null, $this->suite);
            $spec->setPending();
            expect($spec->isPending())->toBe(true);
        });
        it('returns false when the spec is not pending', function () {
            $spec = new Spec('SpecTitle', function () {
            }, $this->suite);
            $spec->run();
            expect($spec->isPending())->toBe(false);
        });
    });
});