mirror of
https://github.com/metosin/reitit.git
synced 2025-12-17 00:11:11 +00:00
Middleware name is not mandatory
This commit is contained in:
parent
881fb240bc
commit
d60c67c0c3
2 changed files with 0 additions and 12 deletions
|
|
@ -9,10 +9,6 @@
|
||||||
(defrecord Endpoint [meta handler middleware])
|
(defrecord Endpoint [meta handler middleware])
|
||||||
|
|
||||||
(defn create [{:keys [name gen wrap] :as m}]
|
(defn create [{:keys [name gen wrap] :as m}]
|
||||||
(when-not name
|
|
||||||
(throw
|
|
||||||
(ex-info
|
|
||||||
(str "Middleware must have :name defined " m) m)))
|
|
||||||
(when (and gen wrap)
|
(when (and gen wrap)
|
||||||
(throw
|
(throw
|
||||||
(ex-info
|
(ex-info
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,6 @@
|
||||||
|
|
||||||
(testing "middleware records"
|
(testing "middleware records"
|
||||||
|
|
||||||
(testing ":name is mandatory"
|
|
||||||
(is (thrown-with-msg?
|
|
||||||
ExceptionInfo
|
|
||||||
#"Middleware must have :name defined"
|
|
||||||
(middleware/create
|
|
||||||
{:wrap identity
|
|
||||||
:gen (constantly identity)}))))
|
|
||||||
|
|
||||||
(testing ":wrap & :gen are exclusive"
|
(testing ":wrap & :gen are exclusive"
|
||||||
(is (thrown-with-msg?
|
(is (thrown-with-msg?
|
||||||
ExceptionInfo
|
ExceptionInfo
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue