This commit is contained in:
Tommi Reiman 2018-06-05 08:49:30 +03:00
parent a8a96c0e85
commit 0cafb9639d
3 changed files with 2 additions and 9 deletions

View file

@ -246,9 +246,3 @@
[["/a"] ["/a"]])))) [["/a"] ["/a"]]))))
(testing "can be configured to ignore" (testing "can be configured to ignore"
(is (not (nil? (r/router [["/a"] ["/a"]] {:conflicts (constantly nil)}))))))) (is (not (nil? (r/router [["/a"] ["/a"]] {:conflicts (constantly nil)})))))))
(testing "nil routes are stripped"
(is (= [] (r/routes (r/router nil))))
(is (= [] (r/routes (r/router [nil ["/ping"]]))))
(is (= [] (r/routes (r/router [nil [nil] [[nil nil nil]]]))))
(is (= [] (r/routes (r/router ["/ping" [nil "/pong"]])))))

View file

@ -3,8 +3,7 @@
[clojure.set :as set] [clojure.set :as set]
[reitit.middleware :as middleware] [reitit.middleware :as middleware]
[reitit.ring :as ring] [reitit.ring :as ring]
[reitit.core :as r] [reitit.core :as r])
[clojure.string :as str])
#?(:clj #?(:clj
(:import (clojure.lang ExceptionInfo)))) (:import (clojure.lang ExceptionInfo))))

View file

@ -66,7 +66,7 @@
{:conflicts (fn [_])} {:conflicts (fn [_])}
{:router r/linear-router}) {:router r/linear-router})
#_(are [opts] (are [opts]
(is (thrown-with-msg? (is (thrown-with-msg?
ExceptionInfo ExceptionInfo
#"Call to #'reitit.core/router did not conform to spec" #"Call to #'reitit.core/router did not conform to spec"