Sha256: e2c1c8e3132f6dcf325b1cb96945bfb7683e287856da5c6bfc84b5bc4ba0d494
Contents?: true
Size: 1.19 KB
Versions: 11
Compression:
Stored size: 1.19 KB
Contents
// ========================================================================== // Project: SproutCore Costello - Property Observing Library // Copyright: ©2006-2010 Sprout Systems, 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) { T.module("objectAt"); test("should return object at specified index", function() { var expected = T.expected(3), obj = T.newObject(3), len = 3, idx; for(idx=0;idx<len;idx++) { equals(obj.objectAt(idx), expected[idx], 'obj.objectAt(%@) should match'.fmt(idx)); } }); test("should return undefined when requesting objects beyond index", function() { var obj = T.newObject(3); equals(obj.objectAt(5), undefined, 'should return undefined for obj.objectAt(5) when len = 3'); equals(T.object.objectAt(0), undefined, 'should return undefined for obj.objectAt(0) when len = 0'); }); });
Version data entries
11 entries across 11 versions & 1 rubygems