]> source.dussan.org Git - jquery.git/commitdiff
Adds a unit test to control options are being copied by jQuery.Callbacks internally.
authorjaubourg <j@ubourg.net>
Wed, 25 Apr 2012 00:13:26 +0000 (02:13 +0200)
committerjaubourg <j@ubourg.net>
Wed, 25 Apr 2012 00:13:26 +0000 (02:13 +0200)
test/unit/callbacks.js

index acc61f32cf28cdda75fdc83db70d326423d7d82d..d1e8fbd6d3423b0016101a0de83a067b66b04968 100644 (file)
@@ -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" );
+       });
+});