marick/Midje

:fact-filter breaks on creation-time checking

Opened this issue · 2 comments

(change-defaults :fact-filter (complement :slow))

in .midje.clj works when calling load-facts or running tests through lein-midje. The test ignores :slow facts as expected.

However, creation-time checking when loading a namespace does not ignore :slow facts.

@totakke can you expand on what do you mean by creation-time checking?

@rafaeldff Sorry, creation-time checking means automatic checking just after ns loaded. For example, when there are the following tests

(fact "normal"
  0 => 1)

(fact :slow "slow"
  1 => 2)

on .midje.clj

(change-defaults :fact-filter (complement :slow))
$ lein midje #=> normal fact is tested
$ lein midje :filter slow #=> slow fact is tested

This is expected. But creation-time checking ignores .midje.clj, running both tests.

user=> (require 'example.t-core)
;; => normal and slow facts are tested

In my case, cider-refresh hanged because it triggered to run slow tests.

(change-defaults :check-after-creation false)

disables creation-time checking, but it disables lein midje too.

$ lein midje
No facts were checked. Is that what you wanted?

are these behaviors expected?