Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

bind('all') koan #1

Closed
juanghurtado opened this Issue Mar 5, 2012 · 2 comments

Comments

Projects
None yet
2 participants

Hi there,

I'm doing your koans (great work, by the way, thanks a lot!) but I'm stuck at the bind('all') one:

https://github.com/larrymyers/backbone-koans/blob/master/js/koans/aboutEvents.js#L66

The solution should be obj.trigger("custom event");, but it doesn't work. It triggers two events instead of one, so first assertion is not valid.

I'm I doing something wrong? This is my code:

it("Evented objects can bind 'all' as a special event name to capture all triggered events on the object.", function() {
  var callback = jasmine.createSpy('-Custom Event Callback-');

  obj.bind('all', callback);

  obj.trigger("custom event");

  expect(callback.callCount).toBe(1);
  expect(callback.mostRecentCall.args[0]).toBe('custom event');
});
Owner

larrymyers commented Mar 6, 2012

I'm on the road right now, but I should have a chance to look into this later this week.

Glad the koans are proving to be useful. I'll look into this and get back to you.

@larrymyers larrymyers added a commit that referenced this issue Mar 10, 2012

@larrymyers larrymyers Merge pull request #2 from path11/master
Fix for the bug #1 (bind('all') koan)
84a4f40
Owner

larrymyers commented Mar 10, 2012

pull request merged in, should resolve this issue.

@larrymyers larrymyers closed this Mar 10, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment