Skip to content
Snippets Groups Projects
Commit a94f3bc4 authored by Malthe Jørgensen's avatar Malthe Jørgensen
Browse files

Add spec test for port defaults for Postgres and MySQL

parent 08aef105
Branches
Tags
No related merge requests found
......@@ -30,7 +30,7 @@
(assoc (default-pg-spec "") :dbname nil, :somethingrandom nil)
(db.spec/postgres
{:host "localhost"
:port 5432
:port nil
:dbname nil
:db nil
:somethingrandom nil}))
......@@ -39,3 +39,17 @@
(expect
(default-pg-spec "")
(db.spec/postgres {}))
(defn- default-mysql-spec [db]
{:classname "org.mariadb.jdbc.Driver"
:subprotocol "mysql"
:subname (format "//localhost:3306/%s" db)})
;; Check that we default to port 3306 for MySQL databases, if `:port` is `nil`
(expect
(assoc (default-mysql-spec "") :dbname nil)
(db.spec/mysql
{:host "localhost"
:port nil
:dbname nil
:db nil}))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment