예제 #1
0
 $formatter = new ConsoleFormatter();
 context('alignText', function () use($formatter) {
     it('pads strings to align columns', function () use($formatter) {
         $multiArray = array(array('pho', 'b', 'c'), array('a', 'test'));
         $aligned = array('phob   c', 'a  test');
         expect($formatter->alignText($multiArray))->toEqual($aligned);
     });
     it('can use delimiters between columns', function () use($formatter) {
         $multiArray = array(array('pho', 'b', 'c'), array('a', 'test'));
         $aligned = array('pho | b    | c', 'a   | test');
         expect($formatter->alignText($multiArray, ' | '))->toEqual($aligned);
     });
 });
 context('calls to applyForeground', function () use($formatter) {
     it('can set the color black', function () use($formatter) {
         $formattedText = $formatter->black('test');
         expect($formattedText)->toEqual("test");
     });
     it('can set the color red', function () use($formatter) {
         $formattedText = $formatter->red('test');
         expect($formattedText)->toEqual("test");
     });
     it('can set the color green', function () use($formatter) {
         $formattedText = $formatter->green('test');
         expect($formattedText)->toEqual("test");
     });
     it('can set the color cyan', function () use($formatter) {
         $formattedText = $formatter->cyan('test');
         expect($formattedText)->toEqual("test");
     });
     it('can set the color white', function () use($formatter) {