Skip to content

Commit

Permalink
Add a test for h2 identity query.
Browse files Browse the repository at this point in the history
  • Loading branch information
duelinmarkers committed Oct 16, 2009
1 parent 2e41411 commit 5a4f456
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/clj_record/util_test.clj
Expand Up @@ -35,6 +35,10 @@
(are (= _1 (util/id-query-for _2 "table_name"))
"SELECT LAST_INSERT_ID()" {:classname "com.mysql.jdbc.Driver" :subprotocol "mysql"}))

(deftest provides-id-query-for-h2
(are (= _1 (util/id-query-for _2 "table_name"))
"CALL IDENTITY()" {:subprotocol "h2"}))

(deftest throws-if-asked-for-id-query-of-unrecognized-db-spec
(is (thrown? Exception
(util/id-query-for {:classname "com.example.MadeUpDriver" :subprotocol "madeup"}))))
Expand Down

0 comments on commit 5a4f456

Please sign in to comment.