Fork me on GitHub

I’m using clojure.test on a project now after using Midje for a long time. And I miss provided greatly ('s-prerequisites). If you use clojure.test, what do you use with it to test that the function under test calls another function with certain arguments?


@ljosa I'd be somewhat inclined to consider that a smell in unit testing, to be honest.


But, if you must, you can use with-redefs to provide a redefinition of the function that saves its arguments to a local atom or something similar...


Yes, I’ve done that a little, but it’s extremely clunky.


Which is nature's way of saying "Perhaps you shouldn't be doing this?" 🙂


Would it make you feel better if we called it integration testing? 😉


Not much, no 🙂 I use Expectations and it has a side-effects function which does this and I think I've used it just once. Maybe twice. In 22,000 lines of Clojure test code at work.