Skip to content

Commit

Permalink
Add a test showing a customized id-query-for.
Browse files Browse the repository at this point in the history
  • Loading branch information
duelinmarkers committed Sep 4, 2009
1 parent 99cf067 commit 5ad965c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/clj_record/util_test.clj
Expand Up @@ -38,3 +38,12 @@
(deftest throws-if-asked-for-id-query-of-unrecognized-db-spec
(is (thrown? Exception
(util/id-query-for {:classname "com.example.MadeUpDriver" :subprotocol "madeup"}))))

(defmethod util/id-query-for "fake subprotocol" [db-spec table-name]
(str "made up query"))

(deftest provides-id-query-for-whatever-dbms-you-like-if-you-defmethod-for-it
(are (= _1 (util/id-query-for _2 "table_name"))
"made up query" {:subprotocol "fake subprotocol"}))


0 comments on commit 5ad965c

Please sign in to comment.