mirror of
https://github.com/metosin/reitit.git
synced 2026-01-09 16:49:50 +00:00
Routing -> Router, fix tests
This commit is contained in:
parent
f5f1104826
commit
9701a51c5a
2 changed files with 10 additions and 10 deletions
|
|
@ -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 [_]
|
||||
|
|
|
|||
|
|
@ -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)})))))))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue