more test cleanup

Signed-off-by: Sean Corfield <sean@corfield.org>
This commit is contained in:
Sean Corfield 2025-03-17 17:49:46 -07:00
parent d1115c8c42
commit 16c1faeaf6
No known key found for this signature in database

View file

@ -2,13 +2,18 @@
(ns next.jdbc.types-test
"Some tests for the type-assist functions."
(:require [lazytest.experimental.interfaces.clojure-test :refer [deftest is]]
(:require [lazytest.core :refer [defdescribe describe it expect]]
[next.jdbc.types :refer [as-varchar]]))
(set! *warn-on-reflection* true)
(deftest as-varchar-test
(defdescribe as-varchar-tests
(let [v (as-varchar "Hello")]
(is (= "Hello" (v)))
(is (contains? (meta v) 'next.jdbc.prepare/set-parameter))
(is (fn? (get (meta v) 'next.jdbc.prepare/set-parameter)))))
(describe "produces a function"
(it "yields the original value when invoked"
(expect (fn? v))
(expect (= "Hello" (v)))))
(describe "carries metadata"
(it "has a `set-parameter` function"
(expect (contains? (meta v) 'next.jdbc.prepare/set-parameter))
(expect (fn? (get (meta v) 'next.jdbc.prepare/set-parameter)))))))