diff options
author | jaubourg <j@ubourg.net> | 2012-04-25 02:13:26 +0200 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2012-04-25 02:13:26 +0200 |
commit | d17a7f04d45bc95e95eeeb97d87fb86aac5c2508 (patch) | |
tree | d0badda322ba9330a23ba4320521ee93b0edb54b /test | |
parent | ad329384ff7ef449db12ca30650f6637a7fc17f7 (diff) | |
download | jquery-d17a7f04d45bc95e95eeeb97d87fb86aac5c2508.tar.gz jquery-d17a7f04d45bc95e95eeeb97d87fb86aac5c2508.zip |
Adds a unit test to control options are being copied by jQuery.Callbacks internally.
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/callbacks.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/unit/callbacks.js b/test/unit/callbacks.js index acc61f32c..d1e8fbd6d 100644 --- a/test/unit/callbacks.js +++ b/test/unit/callbacks.js @@ -203,3 +203,21 @@ jQuery.each( tests, function( strFlags, resultString ) { }); })(); + +test( "jQuery.Callbacks( options ) - options are copied", function() { + + expect( 1 ); + + var options = { + memory: true + }, + cb = jQuery.Callbacks( options ); + + options.memory = false; + + cb.fire( "hello" ); + + cb.add(function( hello ) { + strictEqual( hello, "hello", "options are copied internally" ); + }); +}); |