lundi 28 mai 2018

Clojure - how to instrument another protocol in implementation

I'm new in Clojure and after searching for it, I turning my problem to SO community.

I'm testing a protocol implementation (deftype) who has a reference to another implementation, so constructor is like this :

(deftype FooImpl [^Protocol2 protocol-2]
    (function bar [_] ... (.bar2 protocol-2))
) 

The ... are somes condition too meet to call the .bar2 function.

The thing that I'm not able to do, is to instrument (conjure.core/instrumenting) the call the .bar2 to validate passed parameter (verify-called-once-with-args).

So problem is this:

(instrumenting [ns/function ;;In normal case with `defn`
                ????] ;; what to write for .bar2
   ....)

Thanks!

Aucun commentaire:

Enregistrer un commentaire