marick / Midje

Midje provides a migration path from clojure.test to a more flexible, readable, abstract, and gracious style of testing
MIT License
1.69k stars 129 forks source link

Available via clojars

Current Version

License: MIT

About Midje

Midje is a test framework for Clojure. I created it to allow programmers to test with ease, to provide a smooth migration path from clojure.test, to support top-down as well as bottom-up testing, to encourage readable tests, to support a balance between abstraction and concreteness, and to be gracious in its treatment of the people who use it.

Gallery

To make tests more readable, Midje makes them look like examples in Clojure books. Here's how The Joy of Clojure uses syntax to explain Clojure:

Here's the same fact about Clojure in Midje, expressed in a way that's just as readable but also machine-checkable:


While Midje assumes you'll be building a test suite with lasting value, it allows you to do that while still using the repl in an idiomatic way.

Here's the start of a typical Midje repl session:

Midje has loaded the tests and run them for the first time. It's also watching for file changes. When it sees them, it loads the changed files and any dependencies. But notice that you still have a repl prompt. That means you can move rapidly and smoothly among typing at the repl to try out code samples or look up documentation, having your editor send code snippets to the repl to evaluate, and saving source or test files to immediately see what passes or fails:


Midje supplies prepackaged checkers that save you the trouble of writing common code:


And so on.

Learning Midje

Tutorial Tutorial (and sales pitch) for the clojure.test user User guide Mailing list

Other Tools

Contributors