Skip to content

Commit

Permalink
Merge pull request #4 from galvo-bowers/patch-1
Browse files Browse the repository at this point in the history
upgrade zonky lib
  • Loading branch information
Bigsy authored Nov 30, 2023
2 parents 00f01f9 + 087059d commit 07da8da
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.11.1"]
[integrant "0.8.0"]
[io.zonky.test/embedded-postgres "2.0.1"]
[io.zonky.test/embedded-postgres "2.0.4"]
[org.clojure/tools.logging "1.2.4"]
[org.clojure/tools.namespace "1.3.0"]
[org.slf4j/slf4j-jdk14 "2.0.1"]]
Expand Down
15 changes: 13 additions & 2 deletions test/pg_embedded_clj/custom_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,21 @@
54321
"/postgres")
:user "postgres"})

(defn extract-postgres-version [input]
(if input
(if-let [matches (re-matches #".*PostgreSQL (\d+\.\d+).*" input)]
(second matches)
"Version not found")
"No postgres result input"))

(deftest can-wrap-around
(testing "using custom port"
(is (= {:version "PostgreSQL 14.5 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4, 64-bit"}
(first (jdbc/query db-spec ["select version()"])))))
(is (= (some-> (jdbc/query db-spec ["select version()"])
first
:version
extract-postgres-version)
"14.8")))

(testing "using custom log redirect"
(is (= true (.exists (io/as-file "wibble.log"))))))
15 changes: 13 additions & 2 deletions test/pg_embedded_clj/default_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,18 @@
5432
"/postgres")
:user "postgres"})

(defn extract-postgres-version [input]
(if input
(if-let [matches (re-matches #".*PostgreSQL (\d+\.\d+).*" input)]
(second matches)
"Version not found")
"No postgres result input"))

(deftest can-wrap-around
(testing "using defaults"
(is (= {:version "PostgreSQL 14.5 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4, 64-bit"}
(first (jdbc/query db-spec ["select version()"]))))))
(is (= (some-> (jdbc/query db-spec ["select version()"])
first
:version
extract-postgres-version)
"14.8"))))

0 comments on commit 07da8da

Please sign in to comment.