Hi all, I hope I'm not reinventing the wheel with this, but I put together a function mocking library to allow for functional test isolation. At this point it handles return values, argument expectations, and invocation counts. I've just put together a core for it so far, but I intend to add some simple functions to aid with the readability as time goes on (depending on what parts annoy me the most, and what suggestions I might get). It works as follows:
(expect [dependency-fn (with-args [#(= 5 %) #(> 3 %)] (times 1 (returns "success")))] (function-under-test)) You can also pass a function to times instead of an integer if you'd like to say "at least X times" and so on. More details and examples are available in the source on github. http://github.com/mclark/test-expect I'd be more than happy to hear any feedback, especially regarding code style and best practices (no lisp experience prior to clojure). The macro was a devil to code, I hope I did ok with it. Thanks! --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---