Sha256: f48837da9db20048f6c5ad2f34eabe4a1dfd3380d67513e0c9d1878fb17ef494

Contents?: true

Size: 1.17 KB

Versions: 41

Compression:

Stored size: 1.17 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            ©2008-2011 Apple Inc. All rights reserved.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================
// ========================================================================
// SC.guidFor Tests
// ========================================================================
/*globals module test ok isObj equals expects */

var objectA, objectB , arrayA, stringA; // 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

41 entries across 41 versions & 1 rubygems

Version Path
sproutcore-1.11.0 lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js
sproutcore-1.11.0.rc3 lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js
sproutcore-1.11.0.rc2 lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js
sproutcore-1.11.0.rc1 lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js
sproutcore-1.10.3.1 lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js
sproutcore-1.10.2 lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js
sproutcore-1.10.1 lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js
sproutcore-1.10.0 lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js
sproutcore-1.10.0.rc.3 lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js
sproutcore-1.10.0.rc.2 lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js
sproutcore-1.10.0.rc.1 lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js
sproutcore-1.9.2 lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js
sproutcore-1.9.1 lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js
sproutcore-1.9.0 lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js
sproutcore-1.8.2.1 lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js
sproutcore-1.8.1 lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js
sproutcore-1.8.0 lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js
sproutcore-1.7.1.beta-java lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js
sproutcore-1.7.1.beta lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js
sproutcore-1.6.0.1-java lib/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js