@@ -33,13 +33,13 @@ describe('$(...)', function () {
3333 expect ( attr ) . toBe ( 'autofocus' ) ;
3434 } ) ;
3535
36- it ( '(key, value) : should set attr' , function ( ) {
36+ it ( '(key, value) : should set one attr' , function ( ) {
3737 var $pear = $ ( '.pear' ) . attr ( 'id' , 'pear' ) ;
3838 expect ( $ ( '#pear' ) ) . toHaveLength ( 1 ) ;
3939 expect ( $pear ) . toBeInstanceOf ( $ ) ;
4040 } ) ;
4141
42- it ( '(key, value) : should set attr' , function ( ) {
42+ it ( '(key, value) : should set multiple attr' , function ( ) {
4343 var $el = cheerio ( '<div></div> <div></div>' ) . attr ( 'class' , 'pear' ) ;
4444
4545 expect ( $el [ 0 ] . attribs [ 'class' ] ) . toBe ( 'pear' ) ;
@@ -539,26 +539,26 @@ describe('$(...)', function () {
539539 } ) ;
540540
541541 describe ( '.hasClass' , function ( ) {
542- function test ( attr ) {
542+ function withClass ( attr ) {
543543 return cheerio ( '<div class="' + attr + '"></div>' ) ;
544544 }
545545
546546 it ( '(valid class) : should return true' , function ( ) {
547547 var cls = $ ( '.apple' ) . hasClass ( 'apple' ) ;
548548 expect ( cls ) . toBe ( true ) ;
549549
550- expect ( test ( 'foo' ) . hasClass ( 'foo' ) ) . toBe ( true ) ;
551- expect ( test ( 'foo bar' ) . hasClass ( 'foo' ) ) . toBe ( true ) ;
552- expect ( test ( 'bar foo' ) . hasClass ( 'foo' ) ) . toBe ( true ) ;
553- expect ( test ( 'bar foo bar' ) . hasClass ( 'foo' ) ) . toBe ( true ) ;
550+ expect ( withClass ( 'foo' ) . hasClass ( 'foo' ) ) . toBe ( true ) ;
551+ expect ( withClass ( 'foo bar' ) . hasClass ( 'foo' ) ) . toBe ( true ) ;
552+ expect ( withClass ( 'bar foo' ) . hasClass ( 'foo' ) ) . toBe ( true ) ;
553+ expect ( withClass ( 'bar foo bar' ) . hasClass ( 'foo' ) ) . toBe ( true ) ;
554554 } ) ;
555555
556556 it ( '(invalid class) : should return false' , function ( ) {
557557 var cls = $ ( '#fruits' ) . hasClass ( 'fruits' ) ;
558558 expect ( cls ) . toBe ( false ) ;
559- expect ( test ( 'foo-bar' ) . hasClass ( 'foo' ) ) . toBe ( false ) ;
560- expect ( test ( 'foo-bar' ) . hasClass ( 'foo' ) ) . toBe ( false ) ;
561- expect ( test ( 'foo-bar' ) . hasClass ( 'foo-ba' ) ) . toBe ( false ) ;
559+ expect ( withClass ( 'foo-bar' ) . hasClass ( 'foo' ) ) . toBe ( false ) ;
560+ expect ( withClass ( 'foo-bar' ) . hasClass ( 'foo' ) ) . toBe ( false ) ;
561+ expect ( withClass ( 'foo-bar' ) . hasClass ( 'foo-ba' ) ) . toBe ( false ) ;
562562 } ) ;
563563
564564 it ( 'should check multiple classes' , function ( ) {
@@ -573,9 +573,9 @@ describe('$(...)', function () {
573573 } ) ;
574574
575575 it ( '(empty string argument) : should return false' , function ( ) {
576- expect ( test ( 'foo' ) . hasClass ( '' ) ) . toBe ( false ) ;
577- expect ( test ( 'foo bar' ) . hasClass ( '' ) ) . toBe ( false ) ;
578- expect ( test ( 'foo bar' ) . removeClass ( 'foo' ) . hasClass ( '' ) ) . toBe ( false ) ;
576+ expect ( withClass ( 'foo' ) . hasClass ( '' ) ) . toBe ( false ) ;
577+ expect ( withClass ( 'foo bar' ) . hasClass ( '' ) ) . toBe ( false ) ;
578+ expect ( withClass ( 'foo bar' ) . removeClass ( 'foo' ) . hasClass ( '' ) ) . toBe ( false ) ;
579579 } ) ;
580580 } ) ;
581581
0 commit comments