Not called

Brian Marick edited this page May 18, 2014 · 2 revisions
Clone this wiki locally

This feature no longer exists in modern versions of Midje. Instead, use variant prerequisite arrows.

If you want to check that a function is never called, do this:

     (defn ostracized [n] (+ 300 n))
     (defn myfun [n] (+ n 33))
       (expect (myfun 3) => 36
               (not-called ostracized)))

expect and not-called are part of semi-sweet mode, the framework upon which midje.sweet is built. Though not as pretty, you can use semi-sweet mode inside facts.