|
|
@@ -96,49 +96,3 @@ describe( 'extend()', function() {
|
|
|
expect( target ).to.have.property( 'd' ).to.equal( 2 );
|
|
|
} );
|
|
|
} );
|
|
|
-
|
|
|
-describe( 'isFunction()', function() {
|
|
|
- it( 'should be true for functions only', function() {
|
|
|
- var utils = modules.utils;
|
|
|
-
|
|
|
- var f1 = function() {};
|
|
|
-
|
|
|
- /* jshint -W054 */ // The Function constructor is a form of eval
|
|
|
- var f2 = new Function( '' );
|
|
|
- /* jshint +W054 */
|
|
|
-
|
|
|
- expect( utils.isFunction( f1 ) ).to.be.true();
|
|
|
- expect( utils.isFunction( f2 ) ).to.be.true();
|
|
|
-
|
|
|
- expect( utils.isFunction( 1 ) ).to.be.false();
|
|
|
- expect( utils.isFunction( 'a' ) ).to.be.false();
|
|
|
- expect( utils.isFunction( true ) ).to.be.false();
|
|
|
- expect( utils.isFunction( undefined ) ).to.be.false();
|
|
|
- expect( utils.isFunction( [] ) ).to.be.false();
|
|
|
- expect( utils.isFunction( {} ) ).to.be.false();
|
|
|
- expect( utils.isFunction( new Date() ) ).to.be.false();
|
|
|
- } );
|
|
|
-} );
|
|
|
-
|
|
|
-describe( 'isObject()', function() {
|
|
|
- it( 'should be true for pure objects only', function() {
|
|
|
- var utils = modules.utils;
|
|
|
-
|
|
|
- var f1 = function() {};
|
|
|
-
|
|
|
- /* jshint -W054 */ // The Function constructor is a form of eval
|
|
|
- var f2 = new Function( '' );
|
|
|
- /* jshint +W054 */
|
|
|
-
|
|
|
- expect( utils.isObject( {} ) ).to.be.true();
|
|
|
- expect( utils.isObject( [] ) ).to.be.true();
|
|
|
-
|
|
|
- expect( utils.isObject( 1 ) ).to.be.false();
|
|
|
- expect( utils.isObject( 'a' ) ).to.be.false();
|
|
|
- expect( utils.isObject( true ) ).to.be.false();
|
|
|
- expect( utils.isObject( undefined ) ).to.be.false();
|
|
|
- expect( utils.isObject( f1 ) ).to.be.false();
|
|
|
- expect( utils.isObject( f2 ) ).to.be.false();
|
|
|
- expect( utils.isObject( null ) ).to.be.false();
|
|
|
- } );
|
|
|
-} );
|