-
Notifications
You must be signed in to change notification settings - Fork 29
3.0 instructions
##Installation
lein-midje
is a plugin, so add this to your
~/.lein/profiles.clj
:
{:user {:plugins [[lein-midje "3.0-alpha4"]]}}
Or you can include it in your project.clj
:
{:profiles {:dev {:plugins [[lein-midje "3.0-alpha4"]]}}}
###Check everything
% lein midje
This loads all files in your project's :tests
and :sources
directories (by default, test
and src
). Facts are checked as they're loaded unless you've changed Midje's configuration. Further,
all clojure.test
tests are loaded. Output looks like this:
>>> clojure.test summary:
Ran 17 tests containing 20 assertions.
0 failures, 0 errors.
>>> Midje summary:
All claims (2284) have been confirmed.
The exit status is 0 if there are no failures, 1 otherwise.
% lein midje scratch.t-core scratch.util.*
Only namespaces matching the arguments are loaded. In the case of the wildcard argument, it would match namespaces like scratch.util.t-foo
, scratch.util.foo.bar.baz.t-quux
, and so on.
All other behavior is the same as the no-argument case.
% lein midje :filter integration # only integration tests
% lein midje scratch.t-core -integration # only non-integration tests
###Autotest
% lein midje :autotest
This begins by loading all the files in the project's :test
and :source
directories. Thereafter, it monitors loaded files for changes. When one changes, it is reloaded. Moreover, all the files that depend on it, either directly or indirectly, are also reloaded. Facts are thereby checked. clojure.test
tests are also rerun.
###Selective autotest
% lein midje :autotest test
One or more arguments after the :autotest
restricts the loading and monitoring to files within the given directories. (Note: not namespaces). The directories are relative to the project root.