@@ -17,6 +17,11 @@ var getFile = function(filePath) {
1717 } ) ;
1818} ;
1919
20+ var getContents = function ( filePath ) {
21+ filePath = 'test/' + filePath ;
22+ return fs . readFileSync ( filePath , 'utf8' ) ;
23+ } ;
24+
2025describe ( 'gulp-csslint' , function ( ) {
2126 describe ( 'cssLintPlugin()' , function ( ) {
2227 it ( 'should pass file through' , function ( done ) {
@@ -246,10 +251,11 @@ describe('gulp-csslint', function() {
246251 stream . end ( ) ;
247252 } ) ;
248253
249- it ( 'should use built-in formatter ' , sinon . test ( function ( done ) {
254+ it ( 'should support built-in CSSLint formatters ' , sinon . test ( function ( done ) {
250255 var a = 0 ;
251256
252257 var file = getFile ( 'fixtures/usingImportant.css' ) ;
258+ var expected = getContents ( 'expected/checkstyle-xml.xml' ) ;
253259
254260 var lintStream = cssLintPlugin ( ) ;
255261 var reporterStream = cssLintPlugin . reporter ( 'checkstyle-xml' ) ;
@@ -268,11 +274,8 @@ describe('gulp-csslint', function() {
268274
269275 reporterStream . once ( 'end' , function ( ) {
270276 a . should . equal ( 1 ) ;
271- sinon . assert . calledOnce ( gutil . log , 'asdasd' ) ;
272- sinon . assert . calledWith ( gutil . log , '<?xml version="1.0" encoding="utf-8"?><checkstyle><file ' +
273- 'name="test/fixtures/usingImportant.css"><error line="2" column="1" severity="warning" ' +
274- 'message="Bad naming: .mybox" source="net.csslint.OOCSS"/><error line="3" column="3" severity="warning" ' +
275- 'message="Use of !important" source="net.csslint.Disallow!important"/></file></checkstyle>' ) ;
277+ sinon . assert . calledOnce ( gutil . log ) ;
278+ sinon . assert . calledWith ( gutil . log , expected ) ;
276279
277280 gutil . log . restore ( ) ;
278281 done ( ) ;
0 commit comments