diff options
author | jaubourg <j@ubourg.net> | 2012-04-25 16:08:38 +0200 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2012-04-25 16:08:38 +0200 |
commit | 245f5a244e024cb99ac84be86f86b88654a909c9 (patch) | |
tree | b1f3412b6ccd6eaf315e7ad7bbc9df2c00261ea6 /test/unit/callbacks.js | |
parent | 97210d4e700aba1b67ac3652303bb685d129aced (diff) | |
download | jquery-245f5a244e024cb99ac84be86f86b88654a909c9.tar.gz jquery-245f5a244e024cb99ac84be86f86b88654a909c9.zip |
Regression: makes sure that all instances of a callback are removed. Unit test added.
Diffstat (limited to 'test/unit/callbacks.js')
-rw-r--r-- | test/unit/callbacks.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/callbacks.js b/test/unit/callbacks.js index 6fca16be9..3e9936238 100644 --- a/test/unit/callbacks.js +++ b/test/unit/callbacks.js @@ -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(); +}); |