On Jun 10, 2013, at 12:22 AM, julianrz <julia...@yahoo.com> wrote: > This may be a little off topic, but does this, or any other framework, solve > some testing inconveniences that exist in Clojure and probably other > functional languages: > 1) testing recursive functions. I want to test what a recursion STEP does, > not the whole function. Can I mock 'recur'? > 3) IoC typically makes code more testable. What are Clojure alternatives for > IoC? Pass all dependencies as parameters to your function?
You can do both of these things in Midje. Midje replaces inversion of control (3) with the metaphor of facts-about-functions that depend on facts about other functions (much as a proof might depend on a lemma). See https://github.com/marick/Midje/wiki/The-idea-behind-top-down-development That given, testing a recursive function (1) becomes a special case: https://github.com/marick/Midje/wiki/Partial-prerequisites > 2) testing sequence, esp. lazy You'll have to be more specific. -------- Latest book: /Functional Programming for the Object-Oriented Programmer/ https://leanpub.com/fp-oo -- -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.