Use custom events for testing unbind instead of the, potentially conflicting, error event.

This commit is contained in:
jeresig 2010-03-24 15:39:58 -04:00
parent 3b221da8b0
commit 1ba2df02d6

View File

@ -443,28 +443,28 @@ test("unbind(type)", function() {
} }
message = "unbind passing 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"; message = "unbind all from event";
$elem.bind('error', error).unbind('error').triggerHandler('error'); $elem.bind('error1', error).unbind('error1').triggerHandler('error1');
message = "unbind all"; message = "unbind all";
$elem.bind('error', error).unbind().triggerHandler('error'); $elem.bind('error1', error).unbind().triggerHandler('error1');
message = "unbind many with function"; message = "unbind many with function";
$elem.bind('error error2',error) $elem.bind('error1 error2',error)
.unbind('error error2', error ) .unbind('error1 error2', error )
.trigger('error').triggerHandler('error2'); .trigger('error1').triggerHandler('error2');
message = "unbind many"; // #3538 message = "unbind many"; // #3538
$elem.bind('error error2',error) $elem.bind('error1 error2',error)
.unbind('error error2') .unbind('error1 error2')
.trigger('error').triggerHandler('error2'); .trigger('error1').triggerHandler('error2');
message = "unbind without a type or handler"; message = "unbind without a type or handler";
$elem.bind("error error2.test",error) $elem.bind("error1 error2.test",error)
.unbind() .unbind()
.trigger("error").triggerHandler("error2"); .trigger("error1").triggerHandler("error2");
}); });
test("unbind(eventObject)", function() { test("unbind(eventObject)", function() {