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])
|
||||
|
||||
(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)
|
||||
(throw
|
||||
(ex-info
|
||||
|
|
|
|||
|
|
@ -10,14 +10,6 @@
|
|||
|
||||
(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"
|
||||
(is (thrown-with-msg?
|
||||
ExceptionInfo
|
||||
|
|
|
|||
Loading…
Reference in a new issue