+test("live with special events", function() {
+ expect(13);
+
+ jQuery.event.special.foo = {
+ setup: function( data, namespaces, handler ) {
+ ok( true, "Setup run." );
+ },
+ teardown: function( namespaces ) {
+ ok( true, "Teardown run." );
+ },
+ add: function( handleObj ) {
+ ok( true, "Add run." );
+ },
+ remove: function( handleObj ) {
+ ok( true, "Remove run." );
+ },
+ _default: function( event ) {
+ ok( true, "Default run." );
+ }
+ };
+
+ // Run: setup, add
+ jQuery("#liveSpan1").live("foo.a", function(e){
+ ok( true, "Handler 1 run." );
+ });
+
+ // Run: add
+ jQuery("#liveSpan1").live("foo.b", function(e){
+ ok( true, "Handler 2 run." );
+ });
+
+ // Run: Handler 1, Handler 2, Default
+ jQuery("#liveSpan1").trigger("foo");
+
+ // Run: Handler 1, Default
+ // TODO: Namespace doesn't trigger default (?)
+ jQuery("#liveSpan1").trigger("foo.a");
+
+ // Run: remove
+ jQuery("#liveSpan1").die("foo.a");
+
+ // Run: Handler 2, Default
+ jQuery("#liveSpan1").trigger("foo");
+
+ // Run: remove, teardown
+ jQuery("#liveSpan1").die("foo");
+
+ delete jQuery.event.special.foo;
+});
+