diff --git a/src/reitit/core.cljc b/src/reitit/core.cljc index fc8b3342..a17bfb2e 100644 --- a/src/reitit/core.cljc +++ b/src/reitit/core.cljc @@ -81,7 +81,7 @@ (defn compile-route [[p m :as route] {:keys [compile] :as opts}] [p m (if compile (compile route opts))]) -(defprotocol Routing +(defprotocol Router (router-type [this]) (routes [this]) (options [this]) @@ -131,7 +131,7 @@ [[] {}] compiled) lookup (impl/fast-map lookup)] (reify - Routing + Router (router-type [_] :linear-router) (routes [_] @@ -175,7 +175,7 @@ lookup)]) [{} {}] compiled) data (impl/fast-map data) lookup (impl/fast-map lookup)] - (reify Routing + (reify Router (router-type [_] :lookup-router) (routes [_] diff --git a/test/cljc/reitit/core_test.cljc b/test/cljc/reitit/core_test.cljc index b099233d..0195bcda 100644 --- a/test/cljc/reitit/core_test.cljc +++ b/test/cljc/reitit/core_test.cljc @@ -1,8 +1,8 @@ (ns reitit.core-test (:require [clojure.test :refer [deftest testing is are]] - [reitit.core :as reitit #?@(:cljs [:refer [Match Routing]])]) + [reitit.core :as reitit #?@(:cljs [:refer [Match]])]) #?(:clj - (:import (reitit.core Match Routing) + (:import (reitit.core Match) (clojure.lang ExceptionInfo)))) (deftest reitit-test @@ -181,9 +181,9 @@ (reitit/router [["/a"] ["/a"]])))) (testing "can be configured to ignore" - (is (instance? - Routing - (reitit/router - [["/a"] ["/a"]] - {:conflicts (constantly nil)})))))) + (is (not + (nil? + (reitit/router + [["/a"] ["/a"]] + {:conflicts (constantly nil)})))))))