Changeset 746

Show
Ignore:
Timestamp:
04/24/06 22:56:58 (2 years ago)
Author:
beau@hartshornesoftware.com
Message:

added test for extra signal() parameters

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • mochikit/trunk/tests/test_Signal.js

    r733 r746  
    4040    if (MochiKit.DOM.getElement('submit').fireEvent ||  
    4141        (document.createEvent &&  
    42         (typeof(document.createEvent('MouseEvents').initMouseEvent) == 'function'))) { 
     42        typeof(document.createEvent('MouseEvents').initMouseEvent) == 'function')) { 
    4343         
    4444        /*  
     
    125125    }; 
    126126     
     127    var bFunction = function(someArg, someOtherArg) { 
     128        i += someArg + someOtherArg; 
     129    }; 
     130 
     131     
    127132    var aObject = {}; 
    128133    aObject.aMethod = function() { 
     
    149154    t.is(i, 0, 'New style disconnecting function'); 
    150155    i = 0; 
     156 
     157 
     158    ident = connect(hasSignals, 'signalOne', bFunction); 
     159    signal(hasSignals, 'signalOne', 1, 2); 
     160    t.is(i, 3, 'Connecting function'); 
     161    i = 0; 
     162 
     163    disconnect(ident); 
     164    signal(hasSignals, 'signalOne', 1, 2); 
     165    t.is(i, 0, 'New style disconnecting function'); 
     166    i = 0; 
     167 
    151168 
    152169    connect(hasSignals, 'signalOne', aFunction); 
     
    283300        t.ok(true, 'An exception was raised when connecting an undefined method'); 
    284301    } 
    285  
    286     if (0) { 
    287         // XXX: bob - not sure this warrants an exception 
    288         try { 
    289             disconnect(hasSignals, 'signalOne', aObject, aObject.nothing); 
    290             t.ok(false, 'An exception was not raised when disconnecting an undefined method'); 
    291         } catch (e) { 
    292             t.ok(true, 'An exception was raised when disconnecting an undefined method'); 
    293         } 
    294     } 
    295302     
    296303    try { 
     
    302309    } 
    303310 
    304     if (0) { 
    305         // XXX: bob - not sure this warrants an exception 
    306         try { 
    307             disconnect(hasSignals, 'signalOne', aObject, 'nothing'); 
    308             t.ok(false, 'An exception was not raised when disconnecting an undefined method (as string)'); 
    309         } catch (e) { 
    310             t.ok(true, 'An exception was raised when disconnecting an undefined method (as string)'); 
    311         } 
    312     } 
    313  
    314311    t.is(i, 0, 'Signals should not have fired'); 
    315312