A tiny (~20kb jar) Clojure library designed to offer a helping hand when testing. For those familiar with midje,
you can think of think of this as 'midje-lite'. It provides the majority of features provided my midje, at a fraction of the cost
(code-bloat, number of transitive dependencies, AOT issues etc).
In addition, fudje offers a convenient migration path away from midje, by introducing its own fact
& tabular
macros which
rewrite your existing midje facts into midje-free code (more on this in the intro.md). This allows for smooth & gradual migration,
as you are, not only able to start writing new tests, but also automatically-(ish) migrating old ones.
This library can (potentially) be of interest to you if:
This library will NOT be of any interest to you if:
midje.sweet
=> fudje.sweet
in the ns declaration.(require '[fudje
[core :refer [mocking in-background]]
[sweet :refer :all]])
(defn increment [x]
(inc x))
(defn decrement [x]
(dec x))
(mocking [(increment 1) => (dec 1)
(decrement 2) => 3]
(is (= 0 (increment 1)))
(is (= 3 (decrement 2))))
=> true
(mocking [(increment 1) => :whatever]
(is (= :whatever (increment 2)))) ;; 1 failure (wrong argument passed)
Fail in blah-blah-blah
Function `user$increment@58d6dddc` was called with unexpected arguments!"
expected: [1]
actual: [2]
=> true
Please consult the intro for a more comprehensive demo.
Fudje has been tested against Clojure versions 1.5.1, 1.6, 1.7 and 1.8, but should work with earlier versions as well (possibly down to 1.2). The oldest JDK you can use is 1.6.
Copyright © 2016 Dimitrios Piliouras
Distributed under the Eclipse Public License, the same as Clojure.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close