Middleware name is not mandatory

This commit is contained in:
Tommi Reiman 2017-09-08 08:27:32 +03:00
parent 881fb240bc
commit d60c67c0c3
2 changed files with 0 additions and 12 deletions

View file

@ -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

View file

@ -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