Eggplant is a behaviour driven development (BDD) library for Clojure. Eggplant's focus is on data driven testing to enable a data driven language such as Clojure to be adequately tested. It will use specifications written in a very simple user friendly language to enforce executable tests that can be automated along with providing living documentation.
Our Motto: "Simplicity is key"
Eggplant just works, it has simple to read phrases and a BDD style test can be written in under 30 seconds, we do not try and over complicate things.
;; Preferable way of writing user readable
(defspec example-specification-multiplication
(testing "Example specification showing multiplication given 2 when we process 2 * 2 then we expect 4"
(given 2 test-data
(then-we-expect 4 (when-we-process * 2 test-data)))))
(defspec example-specification-true
(testing "A full length example specification which is true 4 * 2 = 8"
(given 4 test-data
(then-we-expect 8 (when-we-process * 2 test-data)))))
(defspec example-specification-false
(testing "A full length example specification which is false 4 * 2 = 6 ! False"
(given 4 test-data
(then-we-do-not-expect 6 (when-we-process * 2 test-data)))))
(defspec example-specification-with-strings
(testing "String upper case specification"
(given "tom" test-data
(then-we-expect "TOM" (when-we-process str/upper-case test-data)))))
(defspec example-table-test
(testing "Example table testing + with assertion of ="
(-> (expect (function-under-test +) (assertion =))
(where
(test-data-row [3 3] 6)
(test-data-row [4 4] 8)
(test-data-row [2 3] 5)))))
Always looking for contribution so please reach out and take some of the issues or create new ones. Beginner friendly.
[eggplant "0.1.1"]
compile "eggplant:eggplant:0.1.1"
<dependency>
<groupId>eggplant</groupId>
<artifactId>eggplant</artifactId>
<version>0.1.1</version>
</dependency>
Thanks to some key players in the Clojure space that makes this fun all possible:
Can you improve this documentation? These fine people already did:
egg-plant & StuartEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close