Fork me on GitHub
#clojure-spec
<
2017-11-16
>
stathissideris12:11:02

does anyone have a good way to instrument everything before running lein test from the command line?

gfredericks12:11:23

@stathissideris leiningen injections ought to do it

stathissideris12:11:21

@gfredericks thanks, I’ll read up on that 🙂

souenzzo14:11:33

(defmulti mkop :op)
(defmulti mkop' :op)
(s/fdef mkop
        :args (s/cat :args (s/multi-spec mkop' :op)))
(defmethod mkop :sum
  [{:keys [a b]}]
  (+ a b))
(defmethod mkop' :sum
  [_]
  (s/keys :req [::a ::b]))
(defmethod mkop :inc
  [{:keys [a]}]
  (inc a))
(defmethod mkop' :inc
  [_]
  (s/keys :req [::a]))
There is something wrong with this "pattern" for spec on multispec? Someone else doing something like this? Other options?

gklijs16:11:07

Not really sure what your trying to do. @souenzzo

souenzzo17:11:15

@gklijs I'm trying to make a spec to a multimethod

jumar20:11:36

@souenzzo I don't have an experience with multi-spec per se, but if you are trying to to instrument multimethod, that's not currently possible with spec. You'll need to create a wrapper function for multimethod and spec that one.

gklijs17:11:59

ok, no experience with that, I was busy using multi methods handling specs, so I can edit certain data based on it’s spec in the browser