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.
Blog: https://perkss.github.io/#/clojure#text-body
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.
Runs the same as clojure.test
so will work in any IDE and with any driver such as lein test
displaying the same differences between expected and actual.
[eggplant.core :refer :all]
(defspec multiplying-two-numbers
(specification
{:given "a input of :a and :b"
:when "we #* :c"
:then "we expect :result"
:data {:a 3 :b 4 :result 12}}))
(defspec change-a-string-to-uppercase
(specification
{:given "a input of :a"
:when "we #clojure.string/upper-case"
:then "we expect :result"
:data {:a "hello" :result "HELLO"}}))
(defspec finding-the-max-of-two-numbers
(specification
{:expect "the #max of :a and :b"
:where {:a 2 :b 3 :expected 3}}))
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>
Many thanks to those who have contributed to Eggplant:
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, Stuart, perkss & Stuart PerksEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close