}
public function __toString() {
- return sprintf( "%s: %s\ncwd: %s", $this->command, $this->STDERR, $this->cwd );
+ return sprintf( "%s: %s\n" . "cwd: %s\n" . "exit status: %d",
+ $this->command, $this->STDERR, $this->cwd, $this->return_code );
}
}
}
}
-function checkString( $output, $expected, $action ) {
+function checkString( $output, $expected, $action, $message = false ) {
switch ( $action ) {
case 'be':
}
if ( !$r ) {
- throw new Exception( $output );
+ if ( false === $message )
+ $message = $output;
+ throw new Exception( $message );
}
}
function ( $world, $stream, $action, PyStringNode $expected ) {
$expected = $world->replace_variables( (string) $expected );
- checkString( $world->result->$stream, $expected, $action );
+ checkString( $world->result->$stream, $expected, $action, $world->result );
}
);