ok, just for the record, I fixed it. Instead of (resolve 'a) you must
use (ns-resolve
'test-namespace 'a), because lein test runs the tests in namespace
'userinstead of the one that defined the test (as I wrongly assumed).
Also the
first test for the existence of the var is wrong, I assumed resolve
This works ok at the REPL:
(def ^{:k :v} a 4)
(:k (meta (resolve 'a)))
;=> evaluates to :v, ok.
But the same didn't worked inside a clojure.test/deftest:
(deftest mytest
(def ^{:k :v} b 4)
(is (= (resolve 'b) nil)) ;; passed, var is resolved ok
(is (= (:k (meta (resolve 'b)))