The vast majority of my tests look like: do some setup, do some action, make a half-dozen assertions. Almost always in that order.
The only reason I can think of that I would need to have assertions in the middle is if I plan to do more setup and action and assertions afterwards. And in that case, I'm really just writing a second test that should probably be its own test-fn. And if it relies on the setup from the first test, I should probably just extract it out into a function with common setup. I think I'm almost sold on this idea now. On Wed, Jul 24, 2013 at 10:07 AM, John D. Hume <duelin.mark...@gmail.com>wrote: > I've never tried it, but I like the idea of test fns returning their > results. > > On Jul 24, 2013 8:30 AM, "Steven Degutis" <sbdegu...@gmail.com> wrote: > > > > Also, I've been considering having a non-side-effecty way of returning > test results. What do people think? It would get rid of the last bit of > magic in the lib. > > > > > > ;; current style (side-effecty) > > > > (defn test-1 [] > > (let [foo (get-foo)] > > (expect empty? foo) > > (expect awesome? foo))) > > > > ;; proposed style (more functional) > > > > (defn test-1 [] > > (let [foo (get-foo)] > > [(expect empty? foo) > > (expect awesome? foo)])) > > > > -- > -- > 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. > > > -- -- 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.