Fork me on GitHub
#testing
<
2017-01-05
>
benrady19:01:42

I think I'm missing something about how to define methods for the "assert-expr" multimethod in clojure.test.

benrady19:01:56

I'm trying to write one for clojure.spec/valid? so that I can make the output more comprehensible.

benrady19:01:36

I have it working, but the namespace has to match exactly. If I use spec/valid? instead of s/valid? in my tests it doesn't work.

benrady19:01:54

Is that just a limitation of multimethods? Or am I doing something wrong?

metametadata19:01:08

@benrady I'm not sure but maybe you should try defining the method for 'clojure.spec/valid? value and then invoke (is (::s/valid? ,,,)) - note the :: which will expand the symbol's namespace to clojure.spec

benrady20:01:37

Doesn't seem to work. Wouldn't that just treat valid? as a namespaced keyword and not actually call clojure.spec/valid?

metametadata23:01:09

hm, is is a special macro and it should prevent calling it