Using Cider in Spacemacs, I can't seem to find a way to run tests that are defined in the attribute map of defn. Take this function definition for example:
(defn contains-duplicates-a?
"checks if a vector of strings contain duplicates"
{:test #(do
(is (contains-duplicates-a? ["aa" "aa"]))
(is (not (contains-duplicates-a? ["aa" "aaa"])))
(is (not(contains-duplicates-a? ["ba" "ab"])))
(is (not (contains-duplicates-a? ["abcde" "xyz" "ecdab"]))))}
[word-vector]
(not(=
(count word-vector)
(count (distinct word-vector)))))
This style of writing unit tests is fairly common at my company and it's supported by our most common IDE setup (IntelliJ + Cursive). We like having the unit tests close to the code.
I'm not sure it can be achieved by using cider-test-defining-forms
, as whatever you add there has to be a 'top level form' (doc).
Am i missing something, or is it simply not supported?