Sha256: e2edca1eb3ded08bc5dcf02698ab703018bdd629477bbe0f3a83b6e36c2474db
Contents?: true
Size: 1.35 KB
Versions: 9
Compression:
Stored size: 1.35 KB
Contents
// ========================================================================== // Project: SproutCore Costello - Property Observing Library // Copyright: ©2006-2009 Sprout Systems, Inc. and contributors. // Portions ©2008-2009 Apple, Inc. All rights reserved. // License: Licened under MIT license (see license.js) // ========================================================================== /*globals module test ok equals same CoreTest */ sc_require('debug/test_suites/array/base'); SC.ArraySuite.define(function(T) { var observer, obj ; module(T.desc("pushObject"), { setup: function() { obj = T.newObject(); observer = T.observer(obj); } }); test("returns pushed object", function() { var exp = T.expected(1)[0]; equals(obj.pushObject(exp), exp, 'should return receiver'); }); test("[].pushObject(X) => [X] + notify", function() { var exp = T.expected(1); observer.observe('[]', 'length') ; obj.pushObject(exp[0]) ; T.validateAfter(obj, exp, observer, YES); }); test("[A,B,C].pushObject(X) => [A,B,C,X] + notify", function() { var after = T.expected(4), before = after.slice(0,3), value = after[3]; obj.replace(0,0,before); observer.observe('[]', 'length') ; obj.pushObject(value) ; T.validateAfter(obj, after, observer, YES); }); });
Version data entries
9 entries across 9 versions & 1 rubygems