@@ -46,16 +46,22 @@ describe('\'isEqual\'', function () {
4646 htmlDiffer . isEqual ( files . html1 , files . html2 ) . must . be . true ( ) ;
4747 } ) ;
4848
49- it ( 'must sort values of attributes as JSON' , function ( ) {
50- var htmlDiffer = new HtmlDiffer ( { compareAttributesAsJSON : [ 'a' , 'b' ] } ) ,
49+ it ( 'must sort values of attributes as JSON when the content is not a function ' , function ( ) {
50+ var htmlDiffer = new HtmlDiffer ( { compareAttributesAsJSON : [ 'a' , { name : 'b' , isFunction : false } ] } ) ,
5151 files = readFiles ( 'sort-values-in-json-format' ) ;
5252
5353 htmlDiffer . isEqual ( files . html1 , files . html2 ) . must . be . true ( ) ;
5454 } ) ;
5555
56- it ( 'must sort values of attributes \'onclick\' and \'ondblclick\' as JSON' , function ( ) {
57- var htmlDiffer = new HtmlDiffer ( { compareAttributesAsJSON : [ 'onclick' , 'ondblclick' ] } ) ,
58- files = readFiles ( 'onclick-and-ondblclick' ) ;
56+ it ( 'must sort values of attributes as JSON when the content is a function' , function ( ) {
57+ var options = {
58+ compareAttributesAsJSON : [
59+ { name : 'onclick' , isFunction : true } ,
60+ { name : 'ondblclick' , isFunction : true }
61+ ]
62+ } ,
63+ htmlDiffer = new HtmlDiffer ( options ) ,
64+ files = readFiles ( 'sort-functions-in-json-format' ) ;
5965
6066 htmlDiffer . isEqual ( files . html1 , files . html2 ) . must . be . true ( ) ;
6167 } ) ;
@@ -102,7 +108,7 @@ describe('\'isEqual\'', function () {
102108 htmlDiffer . isEqual ( files . html1 , files . html2 ) . must . be . false ( ) ;
103109 } ) ;
104110
105- it ( 'must work preset \'bem\'' , function ( ) {
111+ it ( 'must work \'bem\' preset ' , function ( ) {
106112 var htmlDiffer = new HtmlDiffer ( 'bem' ) ,
107113 files = readFiles ( 'bem-preset' ) ;
108114
0 commit comments