Happens when I want to test a function where the result is another function.
I have something like this:
ns flexsearch.core
(defn init [{:keys [tokenizer split indexer filter] :as options}]
(let [encoder (get-encoder (:encoder options))]
…
I have a function that saves some text to a file:
(defn save-keypair
"saves keypair to ~/.ssb-clj/secret"
[pair file-path]
(let [public-key-string (->> (:public pair) (.array) (byte-array) (b64/encode) (bs/to-string))
secret-key-string…
I am unable to remove duplication inside a clojure.test test.
Suppose I have multiple implementations for the same abstraction:
(defn foo1 [] ,,,)
(defn foo2 [] ,,,)
(defn foo3 [] ,,,)
and I also have a test that all implementations should…
Context
I have a function that operates on a data structure.
I have written a spec for the data structure this function operates on.
This function returns a reagent component that is rendered in a browser (PhantomJS)
The spec has some optional…
In my clojure project I built several java classes using gen-class command. They are [extractor.yaml YAMLExtractor YAMLExtractorFactory]. I wanted now build unit test against those classes but I have error: java.lang.ClassNotFoundException:…
I am writing a clojure.test unit test for a rather large function in my application. This function makes several calls to db and external REST services and does some computation.
for example, my function to be tested is like so
(defn myfunc [id]
…
just like midje lets us wrap facts in a with-state-changes form to specify what should run specifically before, around or after them or the content, how does one accomplish the same with clojure.test