The new ::spec/routes

This commit is contained in:
Tommi Reiman 2017-09-08 08:29:31 +03:00
parent 3bc42a8de8
commit 4074d31a99
2 changed files with 6 additions and 2 deletions

View file

@ -26,7 +26,8 @@
(s/def ::route
(s/cat :path ::path
:meta ::meta))
:meta ::meta
:result (s/? any?)))
(s/def ::routes
(s/or :route ::route

View file

@ -7,7 +7,7 @@
#?(:clj
(:import (clojure.lang ExceptionInfo))))
(stest/instrument `reitit/router)
(stest/instrument `reitit/router `reitit/routes)
(deftest router-spec-test
@ -44,6 +44,9 @@
["/api" []
["/ipa"]])))
(testing "routes conform to spec (can't spec protocol functions)"
(is (= true (s/valid? ::spec/routes (reitit/routes (reitit/router ["/ping"]))))))
(testing "options"
(are [opts]