On Oct 24, 2010, at 2:03 PM, Felix H. Dahlke wrote:

> I just read through this thread again and noticed that I didn't notice
> you mentioning that I can stub functions within tests. I had a look at
> the clojure.test documentation, but I didn't find an example of that.


In Midje <http://github.com/marick/Midje>, you stub by listing a function as a 
prerequisite to the function you're test-driving. For example:

(fact
    (numerical-reverser 103) => 301
    (provided 
      (string-reverser "103") => "301"))

(That's the "sweet" syntax, which is built on top of a plain functions-and-maps 
interface.) 

-----
Brian Marick, independent consultant
Mostly on agile methods with a testing slant
Author of /Programming Cocoa with Ruby/
www.exampler.com, www.exampler.com/blog, www.twitter.com/marick

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to