marick / lein-midje

Leiningen plugin for Midje
MIT License
77 stars 29 forks source link

Remove bundled bultitude code #20

Closed anttipoi closed 12 years ago

anttipoi commented 12 years ago
anttipoi commented 12 years ago

Here's how I tested this:

For Leiningen 1

lein1 new test-lein-1

...implement some facts under test

...modify project.clj: add dev-deps to midje and lazytest

lein1 plugin install lein-midje 1.0.9 (assuming you've built the plugin and made it available for maven, local repo is enough)

lein1 midje

lein1 midje --lazytest

lein1 midje test-lein-1.test.core (or whaterver)

For Leiningen 2

lein2 new test-lein-2

...implement some facts under test

...modify project.clj: add deps to midje and lazytest in :test profile :profiles {:test {:repositories {"stuartsierra-releases" "http://stuartsierra.com/maven2"} :dependencies [[midje "1.3.1"] [com.stuartsierra/lazytest "1.2.3"]]}})

install plugin: in ~/.lein/profiles.clj (you should be able to put the :plugins entry in project.clj as well): {:user {:plugins [[lein-midje "1.0.9"]]}}

lein2 midje --lazytest

lein2 midje test-lein-2.core-test (or whaterver)

KNOWN ISSUES

Note: the ns wildcard notation 'foo.*' does not work. It does not work for me in 1.0.8 and Leiningen 1 either, so that's due to something else. I plan to have a look at that.

anttipoi commented 12 years ago

The wildcard issue is due to leiningen.util.ns/namespaces-matching failure: it fails to convert dashes in namespace name to underscores when looking for files.

Bultitude seems to be better equipped in this sense: it does the conversion.

AlexBaranosky commented 12 years ago

@anttipoi somebody (me or you) should probably do a string replace of dashes to underscores to fix that wildcard bug.

anttipoi commented 12 years ago

@AlexBaranosky That would work. I initially thought that since the function uses the passed-in prefix also as a namespace name prefix, it wouldn't, but in our use case we are interested in code form directories only.

I'm a bit busy over the coming days, but I will return to this later on: also the dependencies question needs a bit more looking into, as discussed on the leiningen group.