private function runBeforeEachHooks(Suite $suite, Spec $spec)
    {
        if ($suite->getParent()) {
            $this->runBeforeEachHooks($suite->getParent(), $spec);
        }

        $hook = $suite->getHook('beforeEach');
        $this->runRunnable($hook);
        if (!$spec->getException() && $hook) {
            $spec->setException($hook->getException());
        }
    }