'test post notification with name and object' : function() { var nc = new NotificationCenter(); var o = new Observer(nc); var s = new Sender(); o.observe('notification', s); nc.post('notification', s); assert.equal(o.observed[0].name, 'notification'); assert.equal(o.observed[0].object, s); assert.equal(o.observed[0].info, null); },
'test post notification with name object and info' : function() { var nc = new NotificationCenter(); var o = new Observer(nc); var s = new Sender(); o.observe('notification', s); nc.post('notification', s, { foo: 'bar' }); assert.equal(o.observed[0].name, 'notification'); assert.equal(o.observed[0].object, s); assert.equal(o.observed[0].info['foo'], 'bar'); },