2

If I have a Clojure test suite written using the Midje testing framework, how do I skip individual tests? For example, if I were using JUnit in Java and I wished to skip a single test, I would add an @Ignore attribute above that test method. Is there an equivalent to this for Midje?

I realise that I could add a label to my test metadata and then run the test suite excluding that label. For example, if I labelled my test with ":dontrun", I could then run the test suite with "lein midje :filter -dontrun". This would involve a change to my Continuous Integration task that runs the test suite though, and I'd prefer not to do this. Is there an equivalent test label of JUnit's @Ignore so that I only need to change the Midje test code and not change my Continuous Integration task?

4

1 に答える 1

4

future-factあなたが望むことをします、それであなたfactを置き換える(またはラップする)だけです:

(future-fact "an interesting sum"
   (sum-up 1 2) => 4)

これは、テスト コードを実行する代わりに、テストの実行中にメッセージを出力します。

WORK TO DO "an interesting sum" at (some_tests.clj:23)
于 2016-05-19T10:31:16.593 に答える