protected function _run()
{
if ($this->_passed !== null) {
return $this;
}
$spec = $this->_actual;
if (!$spec instanceof Specification) {
$this->_passed = false;
return $this;
}
$closure = function () use($spec) {
$success = true;
try {
$success = $spec->passed();
} catch (Exception $e) {
}
return $success;
};
try {
$this->_spin($closure);
} catch (TimeoutException $e) {
}
$this->_logs = $spec->logs();
$this->_passed = $spec->passed() && $this->_passed;
return $this;
}