Changeset 25429 in project


Ignore:
Timestamp:
10/25/11 19:52:01 (9 years ago)
Author:
certainty
Message:

Fixed examples so that they don't reference the obsolete 'to' in expects.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/missbehave

    r24716 r25429  
    2727=== Examples
    2828<enscript highlight=scheme>
    29 (use missbehave miscmacros)
     29(use missbehave missbehave-matchers missbehave-stubs miscmacros)
    3030
    3131(define (callee . args) 'called)
     
    4444         (expect #t (be true)))
    4545     (it "must be a string"
    46          (expect "hello" to (be a string)))
     46         (expect "hello" (be a string)))
    4747     (it "can use standard operators"
    4848         (expect 3 (be > 0)))
     
    5959    (context "Application-count"
    6060      (it "checks application count"
    61           (expect (call-it 1) to (call callee once)))
     61          (expect (call-it 1) (call callee once)))
    6262      (it "checks application count > 1"
    63           (expect (call-it 4) to (call callee (4 times))))
     63          (expect (call-it 4) (call callee (4 times))))
    6464      (it "checks for no calls"
    65           (expect (+ 1 1) to (call callee never))))
     65          (expect (+ 1 1) (call callee never))))
    6666    (context "Arguments"
    6767     (it "checks arguments"
    68          (expect (callee 1 2) to (call callee (with 1 2))))
     68         (expect (callee 1 2) (call callee (with 1 2))))
    6969     (it "mixes arguments and application count"
    70          (expect (begin (callee 1 2) (callee 1 2)) to (call callee (with 1 2) twice)))))
     70         (expect (begin (callee 1 2) (callee 1 2)) (call callee (with 1 2) twice)))))
    7171
    7272
     
    7474    (it "can stub return values"
    7575        (stub! callee (returns 'not-called))
    76         (expect (callee) to (be 'not-called)))
     76        (expect (callee) (be 'not-called)))
    7777
    7878    (it "provides temporary stubs"
    7979        (let ((proc (lambda () 'test)))
    80           (expect (proc) to (be 'test))
     80          (expect (proc) (be 'test))
    8181          (with-stubs! ((proc (returns 'passed)))
    82             (expect (proc) to (be 'passed)))
    83           (expect (proc) to (be 'test))))))
     82            (expect (proc) (be 'passed)))
     83          (expect (proc) (be 'test))))))
    8484</enscript>
    8585
Note: See TracChangeset for help on using the changeset viewer.