From a829074b99963fbec6e66158ee538691af9977a5 Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Wed, 12 Mar 2025 18:52:51 -0700 Subject: [PATCH] clean up some tests Signed-off-by: Sean Corfield --- test/next/jdbc_test.clj | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/test/next/jdbc_test.clj b/test/next/jdbc_test.clj index 001ce8b..fd3fd53 100644 --- a/test/next/jdbc_test.clj +++ b/test/next/jdbc_test.clj @@ -5,8 +5,9 @@ (:require [clojure.core.reducers :as r] [clojure.string :as str] - [lazytest.core :refer [around]] - [lazytest.experimental.interfaces.clojure-test :refer [deftest is testing thrown?]] + [lazytest.core :refer [around ok?]] + [lazytest.experimental.interfaces.clojure-test :refer [deftest is testing + thrown?]] [next.jdbc :as jdbc] [next.jdbc.connection :as c] [next.jdbc.prepare :as prep] @@ -26,16 +27,17 @@ (specs/instrument) -(deftest spec-tests +(defdescribe spec-tests + "sanity checks on instrumented function calls" {:context [(around [f] (with-test-db f))]} (let [db-spec {:dbtype "h2:mem" :dbname "clojure_test"}] - ;; some sanity checks on instrumented function calls: - (jdbc/get-datasource db-spec) - (jdbc/get-connection db-spec) - ;; and again with options: + (it "succeeds with a basic db-spec" + (ok? #(jdbc/get-datasource db-spec)) + (ok? #(jdbc/get-connection db-spec))) (let [db-spec' (jdbc/with-options db-spec {})] - (jdbc/get-datasource db-spec') - (jdbc/get-connection db-spec')))) + (it "succeeds with an option-wrapped db-spec" + (ok? #(jdbc/get-datasource db-spec')) + (ok? #(jdbc/get-connection db-spec')))))) (deftest basic-tests {:context [(around [f] (with-test-db f))]}