Tighten middleware spec from collection to vector

This avoids messing up the order of middleware chain accidentally.
This commit is contained in:
Daw-Ran Liou 2019-10-09 08:05:55 -07:00 committed by Tommi Reiman
parent 4a199b918a
commit 69795f5fe7
2 changed files with 2 additions and 2 deletions

View file

@ -8,7 +8,7 @@
;; Specs
;;
(s/def ::middleware (s/coll-of #(satisfies? middleware/IntoMiddleware %)))
(s/def ::middleware (s/coll-of #(satisfies? middleware/IntoMiddleware %) :kind vector?))
(s/def ::get map?)
(s/def ::head map?)
(s/def ::post map?)

View file

@ -81,7 +81,7 @@
(testing "middleware cannot be a list"
(is (thrown-with-msg?
ExceptionInfo
#":reitit.ring.spec/invalid-specs"
#"Invalid route data"
(ring/router
["/api" {:handler identity
:middleware '()}]