From cbeae300d91da26465c0ba32799fb0c632b55311 Mon Sep 17 00:00:00 2001 From: gered Date: Tue, 31 May 2016 18:32:59 -0400 Subject: [PATCH] forgot a few --- test/views/sql/vexec_tests.clj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/views/sql/vexec_tests.clj b/test/views/sql/vexec_tests.clj index f1df75c..3728118 100644 --- a/test/views/sql/vexec_tests.clj +++ b/test/views/sql/vexec_tests.clj @@ -21,28 +21,28 @@ (deftest vexec-runs-query-and-puts-hints (let [sqlvec ["INSERT INTO example (field1, field2, field3) VALUES ('test', 'N', NULL)"] result (vexec! test-view-system test-db sqlvec)] - (is (= [test-db sqlvec] (:jdbc/execute! @redefs-called))) + (is (called-with-args? :jdbc/execute! test-db sqlvec)) (is (= :jdbc/execute!-return-value result)) (is (called-with-args? :views/put-hints! test-view-system [(views/hint nil #{:example} hint-type)])))) (deftest vexec-runs-query-with-returning-clause (let [sqlvec ["INSERT INTO example (field1, field2, field3) VALUES ('test', 'N', NULL) RETURNING *"] result (vexec! test-view-system test-db sqlvec)] - (is (= [test-db sqlvec] (:jdbc/query @redefs-called))) + (is (called-with-args? :jdbc/query test-db sqlvec)) (is (= :jdbc/query-return-value result)) (is (called-with-args? :views/put-hints! test-view-system [(views/hint nil #{:example} hint-type)])))) (deftest namespace-is-passed-along-to-hints-via-vexec (let [sqlvec ["INSERT INTO example (field1, field2, field3) VALUES ('test', 'N', NULL)"] result (vexec! test-view-system test-db sqlvec {:namespace :foobar})] - (is (= [test-db sqlvec] (:jdbc/execute! @redefs-called))) + (is (called-with-args? :jdbc/execute! test-db sqlvec)) (is (= :jdbc/execute!-return-value result)) (is (called-with-args? :views/put-hints! test-view-system [(views/hint :foobar #{:example} hint-type)])))) (deftest manually-provided-hints-to-vexec-are-passed-to-views-system (let [sqlvec ["INSERT INTO example (field1, field2, field3) VALUES ('test', 'N', NULL)"] result (vexec! test-view-system test-db sqlvec [:foo :bar])] - (is (= [test-db sqlvec] (:jdbc/execute! @redefs-called))) + (is (called-with-args? :jdbc/execute! test-db sqlvec)) (is (= :jdbc/execute!-return-value result)) (is (called-with-args? :views/put-hints! test-view-system [(views/hint nil #{:foo :bar} hint-type)])))) @@ -51,7 +51,7 @@ result (vexec! test-view-system test-db sqlvec [:foo :bar])] ; means jdbc/execute! was called which is correct behaviour since the returning option was not specified. ; if jdbc/execute! was really called it would throw an exception since the INSERT query used has a RETURNING clause - (is (= [test-db sqlvec] (:jdbc/execute! @redefs-called))) + (is (called-with-args? :jdbc/execute! test-db sqlvec)) (is (= :jdbc/execute!-return-value result)) (is (called-with-args? :views/put-hints! test-view-system [(views/hint nil #{:foo :bar} hint-type)]))) ; manually reset some things @@ -59,6 +59,6 @@ (reset! query-info-cache {}) (let [sqlvec ["INSERT INTO example (field1, field2, field3) VALUES ('test', 'N', NULL) RETURNING *"] result (vexec! test-view-system test-db sqlvec [:foo :bar] {:returning? true})] - (is (= [test-db sqlvec] (:jdbc/query @redefs-called))) + (is (called-with-args? :jdbc/query test-db sqlvec)) (is (= :jdbc/query-return-value result)) (is (called-with-args? :views/put-hints! test-view-system [(views/hint nil #{:foo :bar} hint-type)]))))