public function run() { Spec::write("\n", true); //xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); foreach ($this->files as $file) { require $file; Spec::setDescribeOutput($this->descriptiveOutput); Spec::run(); } //xdebug_get_code_coverage(); Spec::results(); }
function it($name, $fn) { global $before_closure; $before_objects = $before_closure(); if (empty($before_objects)) { $before_objects = array(); } $failure_count = Spec::$results['fail']; $passed_count = Spec::$results['pass']; $pending_count = Spec::$results['pending']; $fn($before_objects); if (Spec::$results['pending'] > $pending_count || $failure_count === Spec::$results['fail'] && $passed_count === Spec::$results['pass']) { Spec::assert_pending(); array_push(Spec::$pending_messages, $name); } if (Spec::$descriptive) { if ($failure_count < Spec::$results['fail']) { Spec::write("\n " . $name, false, "red"); } else { Spec::write("\n " . $name, false, "green"); } } }