Sha256: 1ea869881349fe3bf121e957c734de4639d8dc76a1097a0bbc13bd031cc07a76
Contents?: true
Size: 1.36 KB
Versions: 7
Compression:
Stored size: 1.36 KB
Contents
// ========================================================================== // Project: SproutCore Costello - Property Observing Library // Copyright: ©2006-2011 Strobe Inc. and contributors. // Portions ©2008-2010 Apple Inc. All rights reserved. // License: Licensed 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("unshiftObject"), { setup: function() { obj = T.newObject(); observer = T.observer(obj); } }); test("returns unshifted object", function() { var exp = T.expected(1)[0]; equals(obj.pushObject(exp), exp, 'should return receiver'); }); test("[].unshiftObject(X) => [X] + notify", function() { var exp = T.expected(1); observer.observe('[]', 'length') ; obj.unshiftObject(exp[0]) ; T.validateAfter(obj, exp, observer, YES); }); test("[A,B,C].unshiftObject(X) => [X,A,B,C] + notify", function() { var after = T.expected(4), before = after.slice(1), value = after[0]; obj.replace(0,0,before); observer.observe('[]', 'length') ; obj.unshiftObject(value) ; T.validateAfter(obj, after, observer, YES); }); });
Version data entries
7 entries across 7 versions & 2 rubygems