From 4074d31a99434a455e0e8d9bfe57595f61a52c62 Mon Sep 17 00:00:00 2001 From: Tommi Reiman Date: Fri, 8 Sep 2017 08:29:31 +0300 Subject: [PATCH] The new ::spec/routes --- src/reitit/spec.cljc | 3 ++- test/cljc/reitit/spec_test.cljc | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/reitit/spec.cljc b/src/reitit/spec.cljc index 8953f3f7..32e956ff 100644 --- a/src/reitit/spec.cljc +++ b/src/reitit/spec.cljc @@ -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 diff --git a/test/cljc/reitit/spec_test.cljc b/test/cljc/reitit/spec_test.cljc index cb3f18a6..d26f3f9d 100644 --- a/test/cljc/reitit/spec_test.cljc +++ b/test/cljc/reitit/spec_test.cljc @@ -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]