2

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.

Benjamin Peter
  • 4,009
  • 2
  • 23
  • 23

1 Answers1

1

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

Brian Marick
  • 1,330
  • 1
  • 11
  • 12
  • Thanks, for the info. After your recent post on the clojure mailing list I tried 1.5 RC. Seems cool, thank you for that! But the whole, execute on require, behavior seems not to fit well with the foreplay vim plugin. Ans since it runs in nrepl, midje is detecting it is running in the repl and prints out the help uppon midje.repl loading. Maybe I'll just have to play around with it a bit longer. – Benjamin Peter Mar 03 '13 at 12:06
  • Maybe it would be more idomatic to use autotest, which seems quite nice after just looking into it. – Benjamin Peter Mar 03 '13 at 12:17