// ======================================================================== // ArrayController Tests // ======================================================================== /*globals module test ok isObj equals expects */ var c, multiple_a, single_a, empty_a, dummy_a ; // global vars module("SC.ArrayController", { setup: function() { c = SC.ArrayController.create() ; multiple_a = [ SC.Object.create({ test: 'NAME0', value: 0, flag: YES, array: [0,0,0] }), SC.Object.create({ test: 'NAME1', value: 1, flag: NO, array: [1,1,1] }) ]; single_a = [ SC.Object.create({ test: 'NAME0', value: 0, flag: YES, array: [0,0,0] }) ]; empty_a = [] ; dummy_a = SC.Object.create(SC.Array, { length: 2, replace: function(idx, amt, objects) { _items.replace(idx,amt,objects) ; set('length', _items.length) ; }, objectAt: function(idx) { return _items.objectAt(idx) ; }, _items: multiple_a }); } }); test("Should act like an empty array if it has non array-like content", function() { var obj, ary = [null, false, "FOOBAR!", 12, {}] ; for (var idx=0, len=ary.length; idx