@@ -707,11 +707,37 @@ describe('assert', function () {
707707
708708 err ( function ( ) {
709709 assert . closeTo ( 1.5 , "1.0" , 0.5 ) ;
710- } , "the arguments to closeTo must be numbers" ) ;
710+ } , "the arguments to closeTo or approximately must be numbers" ) ;
711711
712712 err ( function ( ) {
713713 assert . closeTo ( 1.5 , 1.0 , true ) ;
714- } , "the arguments to closeTo must be numbers" ) ;
714+ } , "the arguments to closeTo or approximately must be numbers" ) ;
715+ } ) ;
716+
717+ it ( 'approximately' , function ( ) {
718+ assert . approximately ( 1.5 , 1.0 , 0.5 ) ;
719+ assert . approximately ( 10 , 20 , 20 ) ;
720+ assert . approximately ( - 10 , 20 , 30 ) ;
721+
722+ err ( function ( ) {
723+ assert . approximately ( 2 , 1.0 , 0.5 ) ;
724+ } , "expected 2 to be close to 1 +/- 0.5" ) ;
725+
726+ err ( function ( ) {
727+ assert . approximately ( - 10 , 20 , 29 ) ;
728+ } , "expected -10 to be close to 20 +/- 29" ) ;
729+
730+ err ( function ( ) {
731+ assert . approximately ( [ 1.5 ] , 1.0 , 0.5 ) ;
732+ } , "expected [ 1.5 ] to be a number" ) ;
733+
734+ err ( function ( ) {
735+ assert . approximately ( 1.5 , "1.0" , 0.5 ) ;
736+ } , "the arguments to closeTo or approximately must be numbers" ) ;
737+
738+ err ( function ( ) {
739+ assert . approximately ( 1.5 , 1.0 , true ) ;
740+ } , "the arguments to closeTo or approximately must be numbers" ) ;
715741 } ) ;
716742
717743 it ( 'members' , function ( ) {
0 commit comments