Regression: makes sure that all instances of a callback are removed. Unit test added.

This commit is contained in:
jaubourg
2012-04-25 16:08:38 +02:00
parent 97210d4e70
commit 245f5a244e
2 changed files with 17 additions and 2 deletions

View File

@@ -235,3 +235,18 @@ test( "jQuery.Callbacks.fireWith - arguments are copied", function() {
strictEqual( hello, "hello", "arguments are copied internally" );
});
});
test( "jQuery.Callbacks.remove - should remove all instances", function() {
expect( 1 );
var cb = jQuery.Callbacks();
function fn() {
ok( false, "function wasn't removed" );
}
cb.add( fn, fn, function() {
ok( true, "end of test" );
}).remove( fn ).fire();
});