marick/Midje — Issue #105: doc: how to prevent Midje to be compiled in production code?
Author: denlab
Created: 2012-02-17 22:54:53+00:00
State: open

Yes there's: https://github.com/marick/Midje/wiki/Production-mode

But I find the doc a bit light:

> To prevent Midje facts and expects from being compiled into your code, set midje.semi-sweet/*include-midje-checks* to false.
> Midje also obeys clojure.test's *load-tests*.

Can you elaborate on the strategy to put in place to avoid compile the Midje tests: Where should we set this variable?
Because setting it in a top level namespace won't work as it will be loaded at the end and then the tests will be deactivated only for this ns.

Maybe give an example project that do that

PS: I find having the tests and the prod code in the same file awesome, especially when coupling it with literate programming (marginalia). But we recently tried to deploy a Clojure app on Heroku, and we needed to separate prod code from tests in differents directories