testing

Testing tools, testing philosophy & methodology...
benrady 2017-01-05T19:24:42.000023Z

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

benrady 2017-01-05T19:25:56.000024Z

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

benrady 2017-01-05T19:26:36.000025Z

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.

benrady 2017-01-05T19:26:54.000026Z

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

metametadata 2017-01-05T19:51:08.000028Z

@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

benrady 2017-01-05T20:02:37.000031Z

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

metametadata 2017-01-05T23:38:09.000032Z

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