All Projects → perkss → eggplant

perkss / eggplant

Licence: Apache-2.0 License
A behaviour driven development (BDD) library for Clojure. Simplicity is key.

Programming Languages

clojure
4091 projects

Projects that are alternatives of or similar to eggplant

hitchstory
Type-safe, StrictYAML based BDD framework for python.
Stars: ✭ 24 (+50%)
Mutual labels:  bdd, bdd-specs, specification, bdd-framework, bdd-tests
kekiri
A .NET framework that supports writing low-ceremony BDD tests using Gherkin language
Stars: ✭ 19 (+18.75%)
Mutual labels:  bdd, specification, bdd-framework
Specs2
Software Specifications for Scala
Stars: ✭ 696 (+4250%)
Mutual labels:  bdd, specification
Kahlan
✔️ PHP Test Framework for Freedom, Truth, and Justice
Stars: ✭ 1,065 (+6556.25%)
Mutual labels:  bdd, spec
framework
Lightweight, open source and magic-free framework for testing solidity smart contracts.
Stars: ✭ 36 (+125%)
Mutual labels:  spec, specification
Specs
The Filecoin protocol specification
Stars: ✭ 249 (+1456.25%)
Mutual labels:  spec, specification
bat
Gherkin based DSL for testing HTTP APIs via Cucumber.JS
Stars: ✭ 30 (+87.5%)
Mutual labels:  bdd, bdd-framework
spec-pattern
Specification design pattern for JavaScript and TypeScript with bonus classes
Stars: ✭ 43 (+168.75%)
Mutual labels:  spec, specification
Pester
Pester is the ubiquitous test and mock framework for PowerShell.
Stars: ✭ 2,620 (+16275%)
Mutual labels:  bdd, bdd-framework
es-abstract
ECMAScript spec abstract operations.
Stars: ✭ 86 (+437.5%)
Mutual labels:  spec, specification
featurebook
A command line tool (and Node.js library) for generating beautiful system specifications from Gherkin source files.
Stars: ✭ 40 (+150%)
Mutual labels:  bdd, specification-by-example
falcon-apispec
apispec plugin that generates OpenAPI specification (aka Swagger Docs) for Falcon web applications.
Stars: ✭ 44 (+175%)
Mutual labels:  spec, specification
Proposals
Tracking ECMAScript Proposals
Stars: ✭ 14,444 (+90175%)
Mutual labels:  spec, specification
Ginkgo
BDD Testing Framework for Go
Stars: ✭ 5,346 (+33312.5%)
Mutual labels:  bdd, bdd-framework
ntast
Notion Abstract Syntax Tree specification.
Stars: ✭ 101 (+531.25%)
Mutual labels:  spec, specification
bdd
JUnit 5 based BDD library to create and run stories and behaviors a.k.a BDD specification tests
Stars: ✭ 25 (+56.25%)
Mutual labels:  bdd, bdd-framework
Awesome-Cucumber
A collection of awesome Cucumber and Gherkin-related resources
Stars: ✭ 33 (+106.25%)
Mutual labels:  bdd, bdd-framework
kheera-testrunner-android
BDD Framework for Android
Stars: ✭ 18 (+12.5%)
Mutual labels:  bdd, bdd-framework
microservices-datadriven
Sample code of application examples to build microservices with converged Oracle database and multi-cloud / hybrid cloud services
Stars: ✭ 28 (+75%)
Mutual labels:  data-driven
gherkin
Pure Rust implementation of Gherkin language (`.feature` file) for Cucumber testing framework.
Stars: ✭ 41 (+156.25%)
Mutual labels:  bdd

eggplant

Behaviour Driven Development (BDD) Library for Clojure

Details

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. The power of Clojure maps will be our friend!

Blog Post on eggplant

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.

Features:

  1. Simplicity: a key feature we do not want to over complicate things.
  2. Keywords: given, when, then, or expect, where form the BDD style of testing.
  3. Data driven: Data driven testing using data tables with the where clause.

How to use:

Please work from the examples below. Basically two forms the give or the expect. Then provide the text and the keyword names making sure to use : before for example :a. On the providing of the function under test name please provide namespace unless in core and prefix it with # to symbolize a function call standard for Clojure anonymous functions. Then provide the map of data in the :data or :where map as appropriate and make sure all keywords provided in the BDD text are mapped appropriately.

Examples

[eggplant.core :refer :all]

(defspec multiplying-two-numbers
  (specification
   {:given "a input of :a and :b"
    :when  "we #*"
    :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}}))

Contribute

Always looking for contribution so please reach out and take some of the issues or create new ones. Beginner friendly.

Dependency

Available: Clojars Project

Leiningen/Boot

    [eggplant "0.2.0"]

Gradle

    compile "eggplant:eggplant:0.2.0"

Maven

    <dependency>
      <groupId>eggplant</groupId>
      <artifactId>eggplant</artifactId>
      <version>0.2.0</version>
    </dependency>

Contributors

Many thanks to those who have contributed to Eggplant:

  • Stuart Perks @perkss
  • Dan Nicolici @dannicolici
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].