@@ -2,7 +2,6 @@ var hooker = require('hooker');
22var sinon = require ( 'sinon' ) ;
33var glob = require ( 'glob' ) ;
44var assert = require ( 'assert' ) ;
5- var Vow = require ( 'vow' ) ;
65var hasAnsi = require ( 'has-ansi' ) ;
76var rewire = require ( 'rewire' ) ;
87
@@ -41,7 +40,13 @@ describe('modules/cli', function() {
4140
4241 function assertNoCliErrors ( vow ) {
4342 return vow . promise . always ( function ( ) {
44- assert ( console . log . getCall ( 0 ) . args [ 0 ] === 'No code style errors found.' ) ;
43+ var stdout = process . stdout . write . getCall ( 0 ) ? process . stdout . write . getCall ( 0 ) . args [ 0 ] : '' ;
44+ var stderr = process . stderr . write . getCall ( 0 ) ? process . stderr . write . getCall ( 0 ) . args [ 0 ] : '' ;
45+ assert . equal (
46+ stdout ,
47+ 'No code style errors found.\n' ,
48+ stderr
49+ ) ;
4550 rAfter ( ) ;
4651 } ) ;
4752 }
@@ -578,7 +583,7 @@ describe('modules/cli', function() {
578583
579584 it ( 'should accept a relative path to a filter module' , function ( ) {
580585 return assertNoCliErrors ( cli ( {
581- errorFilter : './test/data /error-filter.js' ,
586+ errorFilter : '.. /error-filter.js' ,
582587 args : [ 'test/data/cli/error.js' ] ,
583588 config : 'test/data/cli/cli.json'
584589 } ) ) ;
@@ -627,4 +632,13 @@ describe('modules/cli', function() {
627632 } ) ) ;
628633 } ) ;
629634 } ) ;
635+
636+ describe ( 'additionalRules' , function ( ) {
637+ it ( 'should correctly handle additionalRules paths' , function ( ) {
638+ return assertNoCliErrors ( cli ( {
639+ args : [ 'test/data/cli/success.js' ] ,
640+ config : 'test/data/configs/additionalRules/.jscsrc'
641+ } ) ) ;
642+ } ) ;
643+ } ) ;
630644} ) ;
0 commit comments