@@ -28,14 +28,14 @@ vows.options = {
28
28
brief : false ,
29
29
json : false ,
30
30
matcher : / .* / ,
31
- printer : require ( 'vows/printers /console' )
31
+ reporter : require ( 'vows/reporters /console' )
32
32
} ;
33
33
34
- vows . __defineGetter__ ( 'printer ' , function ( ) {
35
- return vows . options . printer ;
34
+ vows . __defineGetter__ ( 'reporter ' , function ( ) {
35
+ return vows . options . reporter ;
36
36
} ) ;
37
37
38
- var stylize = require ( 'vows/printers /console' ) . stylize ;
38
+ var stylize = require ( 'vows/reporters /console' ) . stylize ;
39
39
40
40
// Keeps track of the outcome of vows.
41
41
var total = 0 , honored = 0 ,
@@ -178,9 +178,9 @@ function addVow(/* description & callback */) {
178
178
if ( exception || ! vows . options . brief ) {
179
179
if ( vow . context && lastContext !== vow . context ) {
180
180
lastContext = vow . context ;
181
- vows . printer . print ( [ 'context' , vow . context ] ) ;
181
+ vows . reporter . report ( [ 'context' , vow . context ] ) ;
182
182
}
183
- vows . printer . print ( [ 'vow' , {
183
+ vows . reporter . report ( [ 'vow' , {
184
184
title : vow . description ,
185
185
status : status ,
186
186
exception : exception || null
@@ -342,19 +342,15 @@ function tryFinish(remaining, promise) {
342
342
// If this isn't the last test suite in the chain,
343
343
// emit 'end', to trigger the next test suite.
344
344
if ( promise && promise . listeners ( 'end' ) . length > 0 ) {
345
- if ( vows . options . json ) {
346
- puts ( [ 'end' ] ) ;
347
- } else {
348
- sys . print ( '\n' ) ;
349
- }
345
+ vows . reporter . report ( [ 'end' ] ) ;
350
346
promise . emit ( 'end' , honored , broken , errored ) ;
351
347
} else {
352
348
time = ( new ( Date ) - start ) / 1000 ;
353
349
// The 'finish' event is triggered once all the tests have been run.
354
350
// It's used by bin/vows
355
351
vows . promises [ suites - 1 ] . emit ( "finish" , honored , broken , errored ) ;
356
352
357
- vows . printer . print ( [ 'finish' , {
353
+ vows . reporter . report ( [ 'finish' , {
358
354
honored : honored ,
359
355
broken : broken ,
360
356
errored : errored ,
@@ -373,11 +369,11 @@ function tryFinish(remaining, promise) {
373
369
374
370
//
375
371
// On exit, check that all promises have been fired.
376
- // If not, print an error message.
372
+ // If not, report an error message.
377
373
//
378
374
process . addListener ( 'exit' , function ( ) {
379
375
if ( honored + broken + errored < total ) {
380
- vows . printer . print ( [ 'error' , { error : "An EventEmitter has failed to fire." , type : 'promise' } ] ) ;
376
+ vows . reporter . report ( [ 'error' , { error : "An EventEmitter has failed to fire." , type : 'promise' } ] ) ;
381
377
}
382
378
} ) ;
383
379
@@ -423,7 +419,7 @@ vows.describe = function (subject) {
423
419
buffer = [ ] , suites = 0 ;
424
420
425
421
if ( ! vows . options . brief ) {
426
- this . printer . print ( [ 'subject' , subject ] ) ;
422
+ this . reporter . report ( [ 'subject' , subject ] ) ;
427
423
}
428
424
429
425
return new ( events . EventEmitter ) ( ) . addListener ( 'newListener' , function ( e , listener ) {
0 commit comments