Skip to content

Commit 5194c1f

Browse files
committed
Clean up coercion tests.
1 parent 2b4dc3a commit 5194c1f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/compojure/api/coercion_test.clj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
body => {:beers ["ipa" "apa"]})))
4444

4545
(fact "body-coersion can ba disabled"
46-
(let [no-body-coercion (fn [_] (dissoc mw/default-coercion-matchers :body))
46+
(let [no-body-coercion (constantly (dissoc mw/default-coercion-matchers :body))
4747
app (api
4848
{:coercion no-body-coercion}
4949
beer-route)]
@@ -52,7 +52,7 @@
5252
body => {:beers ["ipa" "apa" "ipa"]})))
5353

5454
(fact "body-coersion can ba changed"
55-
(let [nop-body-coercion (fn [_] (assoc mw/default-coercion-matchers :body (constantly nil)))
55+
(let [nop-body-coercion (constantly (assoc mw/default-coercion-matchers :body (constantly nil)))
5656
app (api
5757
{:coercion nop-body-coercion}
5858
beer-route)]
@@ -71,7 +71,7 @@
7171
body => {:i 10})))
7272

7373
(fact "query-coersion can ba disabled"
74-
(let [no-query-coercion (fn [_] (dissoc mw/default-coercion-matchers :string))
74+
(let [no-query-coercion (constantly (dissoc mw/default-coercion-matchers :string))
7575
app (api
7676
{:coercion no-query-coercion}
7777
query-route)]
@@ -80,7 +80,7 @@
8080
body => {:i "10"})))
8181

8282
(fact "query-coersion can ba changed"
83-
(let [nop-query-coercion (fn [_] (assoc mw/default-coercion-matchers :string (constantly nil)))
83+
(let [nop-query-coercion (constantly (assoc mw/default-coercion-matchers :string (constantly nil)))
8484
app (api
8585
{:coercion nop-query-coercion}
8686
query-route)]
@@ -92,7 +92,7 @@
9292
:query-params [i :- s/Int]
9393
(ok {:i i}))
9494
(GET* "/disabled-coercion" []
95-
:coercion (fn [_] (assoc mw/default-coercion-matchers :string (constantly nil)))
95+
:coercion (constantly (assoc mw/default-coercion-matchers :string (constantly nil)))
9696
:query-params [i :- s/Int]
9797
(ok {:i i}))
9898
(GET* "/no-coercion" []

0 commit comments

Comments
 (0)