From cf06a1757d4efa33c4818212a86ff88df16f9e56 Mon Sep 17 00:00:00 2001 From: Tommi Reiman Date: Mon, 14 Aug 2017 09:50:12 +0300 Subject: [PATCH] Cleanup tests --- test/cljc/reitit/ring_test.cljc | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/test/cljc/reitit/ring_test.cljc b/test/cljc/reitit/ring_test.cljc index 60eb92a2..4a7a1783 100644 --- a/test/cljc/reitit/ring_test.cljc +++ b/test/cljc/reitit/ring_test.cljc @@ -17,6 +17,12 @@ #(respond (update % :body (fnil conj []) name)) raise)))) +(defn handler + ([{:keys [::mw]}] + {:status 200 :body (conj mw :ok)}) + ([request respond raise] + (respond (handler request)))) + (deftest ring-test (testing "simple-router" @@ -29,11 +35,6 @@ (testing "ring-handler" (let [api-mw #(mw % :api) - handler (fn handle - ([{:keys [::mw]}] - {:status 200 :body (conj mw :ok)}) - ([request respond raise] - (respond (handle request)))) router (ring/simple-router [["/ping" handler] ["/api" {:middleware [api-mw]} @@ -77,11 +78,6 @@ (testing "ring-handler" (let [api-mw #(mw % :api) - handler (fn handle - ([{:keys [::mw]}] - {:status 200 :body (conj mw :ok)}) - ([request respond raise] - (respond (handle request)))) router (ring/method-router [["/api" {:middleware [api-mw]} ["/all" handler]