Skip to content

Commit

Permalink
Use custom events for testing unbind instead of the, potentially conf…
Browse files Browse the repository at this point in the history
…licting, error event.
  • Loading branch information
jeresig authored and wycats committed Jun 20, 2010
1 parent d4aff80 commit d54014e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions test/unit/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,28 +443,28 @@ test("unbind(type)", function() {
}

message = "unbind passing function";
$elem.bind('error', error).unbind('error',error).triggerHandler('error');
$elem.bind('error1', error).unbind('error1',error).triggerHandler('error1');

message = "unbind all from event";
$elem.bind('error', error).unbind('error').triggerHandler('error');
$elem.bind('error1', error).unbind('error1').triggerHandler('error1');

message = "unbind all";
$elem.bind('error', error).unbind().triggerHandler('error');
$elem.bind('error1', error).unbind().triggerHandler('error1');

message = "unbind many with function";
$elem.bind('error error2',error)
.unbind('error error2', error )
.trigger('error').triggerHandler('error2');
$elem.bind('error1 error2',error)
.unbind('error1 error2', error )
.trigger('error1').triggerHandler('error2');

message = "unbind many"; // #3538
$elem.bind('error error2',error)
.unbind('error error2')
.trigger('error').triggerHandler('error2');
$elem.bind('error1 error2',error)
.unbind('error1 error2')
.trigger('error1').triggerHandler('error2');

message = "unbind without a type or handler";
$elem.bind("error error2.test",error)
$elem.bind("error1 error2.test",error)
.unbind()
.trigger("error").triggerHandler("error2");
.trigger("error1").triggerHandler("error2");
});

test("unbind(eventObject)", function() {
Expand Down

0 comments on commit d54014e

Please sign in to comment.