marick / lein-midje

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

filtering multiple values #57

Closed narkisr closed 9 years ago

narkisr commented 9 years ago

Running:

lein midje :filter -integration -agent

Results with integration test running ignoring the filtering

marick commented 9 years ago

This is the way it's defined to work. Individual tokens are combined with OR. Therefore:

(fact :agent   ;; this runs because it's "not integration"
  :agent => :failed)

(fact :integration  ;; This runs because it's "not agent"
  :integration => :failed)

This is counterintuitive in this case, but I argue AND would be counterintuitive in the case of the non-negated form.

The solution is to put this in a file, say fast.config:

(change-defaults :fact-filter #(and (not (:agent %))
                                    (not (:integration %))))

... and then run lein midje like this:

581 $ lein midje :config fast.config
marick commented 9 years ago

I'll update the documentation.

narkisr commented 9 years ago

Ok thanks