Sha256: 0677c7479e68caebe9251d32eec25e3d9ec1b0bb1a77142299a7acfbc1d6d441
Contents?: true
Size: 1.42 KB
Versions: 41
Compression:
Stored size: 1.42 KB
Contents
// ========================================================================== // Project: SproutCore - JavaScript Application Framework // Copyright: ©2006-2011 Strobe Inc. and contributors. // ©2008-2011 Apple Inc. All rights reserved. // License: Licensed under MIT license (see license.js) // ========================================================================== // ======================================================================== // SC.Observable Tests // ======================================================================== /*globals module test ok isObj equals expects Namespace */ // .......................................................... // GET() // module("object.observesForKey()", { }); test("should get observers", function() { var o1 = SC.Object.create({ foo: 100 }), o2 = SC.Object.create({ func: function() {} }), o3 = SC.Object.create({ func: function() {} }), observers = null; equals(o1.observersForKey('foo').get('length'), 0, "o1.observersForKey should return empty array"); o1.addObserver('foo', o2, o2.func); o1.addObserver('foo', o3, o3.func); observers = o1.observersForKey('foo'); equals(observers.get('length'), 2, "o2.observersForKey should return an array with length 2"); equals(observers[0][0], o2, "first item in observers array should be o2"); equals(observers[1][0], o3, "second item in observers array should be o3"); });
Version data entries
41 entries across 41 versions & 1 rubygems