Sha256: a763a601a564f560e89b481cf4d3daf3c8bc8de1de356dc93d7f29f4f173498d

Contents?: true

Size: 1.19 KB

Versions: 17

Compression:

Stored size: 1.19 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) {
  
  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

17 entries across 17 versions & 2 rubygems

Version Path
sproutit-sproutcore-1.0.20090721145285 frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js
sproutcore-1.0.1046 frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js
sproutcore-1.0.1043 frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js
sproutcore-1.0.1042 frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js
sproutcore-1.0.1037 frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js
sproutcore-1.0.1035 frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js
sproutcore-1.0.1031 frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js
sproutcore-1.0.1030 frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js
sproutcore-1.0.1029 frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js
sproutcore-1.0.1027 frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js
sproutcore-1.0.1028 frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js
sproutcore-1.0.1026 frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js
sproutcore-1.0.1025 frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js
sproutcore-1.0.1024 frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js
sproutcore-1.0.1009 frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js
sproutcore-1.0.1008 frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js
sproutcore-1.0.1003 frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js