Wiki

Changes between Initial Version and Version 1 of Expect

Show
Ignore:
Timestamp:
02/15/10 01:56:09 (15 years ago)
Author:
hopscc
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Expect

    v1 v1  
     1= Expect = 
     2 
     3This is a statement that provides an assertion capability for checking for thrown exceptions. 
     4 
     5Its usually used in unit test code 
     6 
     7== Grammar == 
     8{{{ 
     9expect EXCEPTIONTYPE 
     10    BLOCK 
     11}}} 
     12 
     13== Examples == 
     14{{{ 
     15expect FormatException 
     16    i = Int.parse('abcdefg') 
     17 
     18expect AssertException 
     19    assert 0 > 1 
     20 
     21ints = [1,2,3]  
     22expect ArgumentOutOfRangeException, print ints[5] 
     23 
     24 
     25expect MyInvalidInputException 
     26    checkInput(GenericInvalidInputObject) 
     27}}} 
     28 
     29== Notes ==