Run tests from a single namespace using clojure and midje 1.4.0

909 Views Asked by At

I want to call my midje 1.4.0 unit tests from one namespace from a clojure repl without leiningen.

The background is I want to call them from a shortcut in vim without all the other tests in the project. I am using vimclojure-static and foreplay.

How can I do such a thing? I searched the midje docu already. It seems there is a way for midje 1.5 but it is still alpha and doesn't seem very comfortable either.

Currently I run midje from the console for all namespaces, not so comfortable:

lein midje

For clojure.test I can use the following shortcut, a similar thing for midje would be appreciated:

command! -bar -bang RunTests :Require!<bang>|Eval (clojure.test/run-tests)

Relevant part is:

(clojure.test/run-tests)

Thanks for reading.

1

There are 1 best solutions below

2
On

As of Midje 1.5 (now a release candidate), the equivalent to run-tests would be (midje.repl/load-facts).