-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from metabase/parse-properties-correctly
Make sure properties are parsed correctly
- Loading branch information
Showing
3 changed files
with
28 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
(ns metabase.connection-pool-test | ||
(:require [clojure.test :as t] | ||
[metabase.connection-pool :as connection-pool])) | ||
|
||
(def ^:private spec | ||
{:classname "org.h2.Driver", :subprotocol "h2", :subname "mem:db"}) | ||
|
||
(t/deftest properties-test | ||
(t/testing "Options passed in to `connection-pool-spec` should get parsed correctly" | ||
(let [description (-> (connection-pool/connection-pool-spec spec {"acquireIncrement" 1 | ||
"testConnectionOnCheckin" true}) | ||
:datasource | ||
str)] | ||
(t/is (= "acquireIncrement -> 1" | ||
(re-find #"acquireIncrement -> \d" description)) | ||
"numeric options should get converted correctly") | ||
(t/is (= "testConnectionOnCheckin -> true" | ||
(re-find #"testConnectionOnCheckin -> \w+" description)) | ||
"boolean options should get converted correctly")))) |