public function scheduleSprint(Sprint $sprint)
 {
     $specification = $this->specRepo->getSpecificationForSprintLength($sprint->getLength());
     if (!$specification) {
         $this->dispatcher->dispatch(self::FAILURE, new Event(['sprint' => $sprint, 'reason' => 'No specification found for sprints with length = ' . $sprint->getLength()]));
         return;
     }
     $sprint->applySpecification($specification);
     $this->projectRepo->save($sprint);
     $this->dispatcher->dispatch(self::SUCCESS, new Event(['sprint' => $sprint]));
 }
 function it_reports_failure_to_the_dispatcher(Sprint $sprint, $dispatcher)
 {
     $sprint->getLength()->willReturn(0);
     $dispatcher->dispatch($this->FAILURE, Argument::any())->shouldBeCalled();
     $this->scheduleSprint($sprint);
 }