Sha256: 920e5494949f9b1251afb416aef62ba549a4a4e25bdb6e07ea08465da1e2b0f0

Contents?: true

Size: 942 Bytes

Versions: 13

Compression:

Stored size: 942 Bytes

Contents

module("item type", {
  setup: function() {
     object = SC.Object.create({
	
	    method:function(){
		
	    }
     });
	
  }   
  
});

test("should return the type for the passed item", function() {
	  a = null;
	  var arr = [1,2,3];
	  var obj = {};
	  
      equals(SC.T_NULL,SC.typeOf(a),"item of type null ");
	  equals(SC.T_ARRAY,SC.typeOf(arr),"item of type array ");		  
	  equals(SC.T_HASH,SC.typeOf(obj),"item of type hash");
	  equals(SC.T_OBJECT,SC.typeOf(object),"item of type object");
	  equals(SC.T_FUNCTION,SC.typeOf(object.method),"item of type function") ;
	  equals(SC.T_CLASS,SC.typeOf(SC.Object),"item of type class");
});

var a,b;
module("none or undefined object type",{
	setup: function() {
		a = null;
		b = undefined; 
  }
});

test("should return true for null and undefined ",function(){
	equals(YES,SC.none(a),"for a null parameter passed  ");
	equals(YES,SC.none(b),"for a undefined parameter passed ");
});

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
sproutit-sproutcore-1.0.0.20090408130025 frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js
sproutit-sproutcore-1.0.0.20090416161445 frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js
sproutit-sproutcore-1.0.0.20090720093355 frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js
sproutit-sproutcore-1.0.0.20090720202429 frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js
sproutit-sproutcore-1.0.0.20090721125122 frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js
sproutit-sproutcore-1.0.126 frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js
sproutit-sproutcore-1.0.20090721145251 frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js
sproutit-sproutcore-1.0.20090721145280 frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js
sproutit-sproutcore-1.0.20090721145281 frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js
sproutit-sproutcore-1.0.20090721145282 frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js
sproutit-sproutcore-1.0.20090721145285 frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js
sproutit-sproutcore-1.0.203 frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js
sproutcore-1.0.1003 frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js