On Wed, Dec 15, 2010 at 6:37 PM, Brian Marick <mar...@exampler.com> wrote: > I'd like to formally announce Midje, a testing framework for Clojure that > emphasizes ease of use, readability, and relationships among functions. > > https://github.com/marick/Midje > > Midje is at 0.8.1. I'd bump it to 1.0. but I don't want to freeze the > interface to some of the newer features just yet.
Cool. > Midje makes it easy to use functions other than equality to check results: > > (facts > (first (primes-greater-than-2)) => odd? > (some-complicated-function) => (in-any-order [1 2 3])) So, a predicate is called on the result instead of tested for equality with the result? And you have something like (defn in-any-order [s] (let [ss (into #{} s)] (fn [x] (= ss (into #{} x))))) and perhaps other functions that return predicates for use as above? > Midje contains other features you might expect from a test framework. For > example, when you have to use state, it gives you a way to set it up or tear > it down: > > (fact > (against-background (before :checks (swap! test-atom (constantly 0)))) > (swap! test-atom inc) => 1 > (swap! test-atom dec) => -1) Why not use (reset! test-atom 0) above? > (background (around :facts (sql/with-connection db ?form))) This doesn't seem to be wrapping anything. What determines its scope? Perhaps I should visit the URL and see if there's more in-depth documentation. :) -- 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