Changeset 96

Show
Ignore:
Timestamp:
12/16/07 01:07:05 (13 months ago)
Author:
iteman
Message:

- Made some minor improvements.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/Stagehand/TestRunner/PHPSpec/Reporter.php

    r95 r96  
    132132    public function output($specs = false) 
    133133    { 
    134         $output = $this->toString($specs); 
     134        $output = preg_replace(array('/(\x0d|\x0a|\x0d\x0a){3,}/', '/^(  -)(.+)/m'), 
     135                               array("\n\n", '$1 $2'), 
     136                               $this->toString($specs) 
     137                               ); 
    135138 
    136139        if ($this->_color) { 
     
    149152            } 
    150153 
    151             print Console_Color::convert(preg_replace(array('/^(\d+ examples?.*)/m', 
    152                                                             '/^(  -)(.+)( \(ERROR|EXCEPTION\))/m', 
    153                                                             '/^(  -)(.+)( \(FAIL\))/m', 
    154                                                             '/^(  -)(.+)( \(PENDING\))/m', 
    155                                                             '/^(  -)(.+)/m', 
    156                                                             '/(\d+\)\s+)(.+ (?:ERROR|EXCEPTION)\s+.+)/', 
    157                                                             '/(\d+\)\s+)(.+ FAILED\s+.+)/', 
    158                                                             '/(\d+\)\s+)(.+ PENDING\s+.+)/', 
    159                                                             '/^((?:Errors|Exceptions):)/m', 
    160                                                             '/^(Failures:)/m', 
    161                                                             '/^(Pending:)/m', 
    162                                                             '/(\x0d|\x0a|\x0d\x0a){2,}/' 
    163                                                             ), 
    164                                                       array("$colorCode\$1%n", 
    165                                                             '%p$1 $2$3%n', 
    166                                                             '%r$1 $2$3%n', 
    167                                                             '%y$1 $2$3%n', 
    168                                                             '%g$1 $2$3%n', 
    169                                                             '$1%p$2%n', 
    170                                                             '$1%r$2%n', 
    171                                                             '$1%y$2%n', 
    172                                                             '%p$1%n', 
    173                                                             '%r$1%n', 
    174                                                             '%y$1%n', 
    175                                                             "\n\n" 
    176                                                             ), 
    177                                                       Console_Color::escape($output)) 
    178                                          ); 
    179         } else { 
    180             print $output; 
     154            $output = Console_Color::convert(preg_replace(array('/^(\d+ examples?.*)/m', 
     155                                                                '/^(  -)(.+)( \(ERROR|EXCEPTION\))/m', 
     156                                                                '/^(  -)(.+)( \(FAIL\))/m', 
     157                                                                '/^(  -)(.+)( \(PENDING\))/m', 
     158                                                                '/^(  -)(.+)/m', 
     159                                                                '/(\d+\)\s+)(.+ (?:ERROR|EXCEPTION)\s+.+)/', 
     160                                                                '/(\d+\)\s+)(.+ FAILED\s+.+)/', 
     161                                                                '/(\d+\)\s+)(.+ PENDING\s+.+)/', 
     162                                                                '/^((?:Errors|Exceptions):)/m', 
     163                                                                '/^(Failures:)/m', 
     164                                                                '/^(Pending:)/m' 
     165                                                                ), 
     166                                                          array("$colorCode\$1%n", 
     167                                                                '%p$1$2$3%n', 
     168                                                                '%r$1$2$3%n', 
     169                                                                '%y$1$2$3%n', 
     170                                                                '%g$1$2$3%n', 
     171                                                                '$1%p$2%n', 
     172                                                                '$1%r$2%n', 
     173                                                                '$1%y$2%n', 
     174                                                                '%p$1%n', 
     175                                                                '%r$1%n', 
     176                                                                '%y$1%n' 
     177                                                                ), 
     178                                                          Console_Color::escape($output)) 
     179                                             ); 
    181180        } 
     181 
     182        print $output; 
    182183    } 
    183184