Sha256: 8de5a61e64d9b7cff8ca733a285e0239da75e23a637931933cc02ebc3d88e745

Contents?: true

Size: 795 Bytes

Versions: 13

Compression:

Stored size: 795 Bytes

Contents

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

var objectA, objectB ; // global variables

module("Beget function Module", {
setup: function() {
    objectA = {} ;
    objectB = {} ;
	arrayA  = [1,3];
	stringA ="stringA";
}
});

test("should return a new object with same prototype as that of passed object", function() {
  	equals(YES, SC.beget(objectA) !== objectA, "Beget for an object") ;
	equals(YES, SC.beget(stringA) !== stringA, "Beget for a string") ;
	equals(YES, SC.beget(SC.hashFor(objectB))!==SC.hashFor(objectB), "Beget for a hash") ;
	equals(YES, SC.beget(arrayA) !== arrayA, "Beget for an array") ;
});

Version data entries

13 entries across 13 versions & 2 rubygems

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