Sha256: d7926791fdb46307281f417eb798a509a99488e54b30c792094080e0d2200953

Contents?: true

Size: 1.38 KB

Versions: 12

Compression:

Stored size: 1.38 KB

Contents

// ========================================================================
// SC.Error Base Tests
// ========================================================================
/*globals module test ok isObj equals expects */

module("SC.ERROR");

test("SC.Error.desc creates an error instance with description,label and code", function() {
  c = SC.Error.desc('This is an error instance','Error Instance',99999);
  equals(SC.T_ERROR,SC.typeOf(c),'Error instance');
  equals('This is an error instance',c.description,'Description');
  equals('Error Instance',c.label,'Label');
  equals(99999,c.code,'Code');
});

test("SC.$error creates an error instance with description,label and code",function(){
  d = SC.$error('This is a new error instance','New Error Instance',99999);
  equals(SC.T_ERROR,SC.typeOf(d),'New Error instance');
  equals('This is a new error instance',d.description,'Description');
  equals('New Error Instance',d.label,'Label');
  equals(99999,d.code,'Code');
});

test("SC.$ok should return YES if the passed value is an error object", function() {
	var denominator = [1,2,0];
	var numerator =3;
	var result = [];
	for(i=0; i<denominator.length ;i++)
	{
		if(denominator[i]!=0)
		{
			result[i]= numerator/denominator[i];
		}
		else
		{
			// err = SC.Error.desc('divide by zero error','Divde by zero error',99999);
			// 			equals(YES,SC.$ok(err),'Is an error');
			// 			break;
		}
	}
});

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
sproutit-sproutcore-1.0.0.20090408130025 frameworks/sproutcore/frameworks/foundation/tests/system/error.js
sproutit-sproutcore-1.0.0.20090416161445 frameworks/sproutcore/frameworks/foundation/tests/system/error.js
sproutit-sproutcore-1.0.0.20090720093355 frameworks/sproutcore/frameworks/foundation/tests/system/error.js
sproutit-sproutcore-1.0.0.20090720202429 frameworks/sproutcore/frameworks/foundation/tests/system/error.js
sproutit-sproutcore-1.0.0.20090721125122 frameworks/sproutcore/frameworks/foundation/tests/system/error.js
sproutit-sproutcore-1.0.126 frameworks/sproutcore/frameworks/foundation/tests/system/error.js
sproutit-sproutcore-1.0.20090721145251 frameworks/sproutcore/frameworks/foundation/tests/system/error.js
sproutit-sproutcore-1.0.20090721145280 frameworks/sproutcore/frameworks/foundation/tests/system/error.js
sproutit-sproutcore-1.0.20090721145281 frameworks/sproutcore/frameworks/foundation/tests/system/error.js
sproutit-sproutcore-1.0.20090721145282 frameworks/sproutcore/frameworks/foundation/tests/system/error.js
sproutit-sproutcore-1.0.20090721145285 frameworks/sproutcore/frameworks/foundation/tests/system/error.js
sproutit-sproutcore-1.0.203 frameworks/sproutcore/frameworks/foundation/tests/system/error.js