Page MenuHomePhabricator
Paste P1163

RspecUnitTestEngine.php
ActivePublic

Authored by avivey on May 23 2014, 8:55 PM.
Tags
None
Referenced Files
F159450: RspecUnitTestEngine.php
May 23 2014, 8:55 PM
Subscribers
None
<?php
/**
* Very basic 'rspec' unit test engine wrapper.
*
* @group unitrun
*/
final class RspecUnitTestEngine extends ArcanistBaseUnitTestEngine {
public function run() {
$tmp_file = new TempFile();
$cmd_line = csprintf("bundle exec rspec --failure-exit-code 0 -r yarjuf -f JUnit -o ${tmp_file}");
$future = new ExecFuture('%C', $cmd_line);
list($stdout, $stderr) = $future->resolvex();
$parser = new ArcanistXUnitTestResultParser();
return $parser->parseTestResults(Filesystem::readFile($tmp_file));
}
}

Event Timeline

avivey changed the title of this paste from untitled to RspecUnitTestEngine.php.
avivey updated the paste's language from autodetect to autodetect.

requires to install https://github.com/natritmeyer/yarjuf to create JUnit format.