mirror of
https://github.com/metosin/reitit.git
synced 2026-02-23 18:32:22 +00:00
Fix tests
This commit is contained in:
parent
9e7df6ca03
commit
79c430d298
2 changed files with 6 additions and 5 deletions
|
|
@ -5,7 +5,8 @@
|
||||||
[reitit.impl :as impl]
|
[reitit.impl :as impl]
|
||||||
#?@(:clj [[ring.util.mime-type :as mime-type]
|
#?@(:clj [[ring.util.mime-type :as mime-type]
|
||||||
[ring.util.response :as response]])
|
[ring.util.response :as response]])
|
||||||
[clojure.string :as str]))
|
[clojure.string :as str]
|
||||||
|
[reitit.exception :as ex]))
|
||||||
|
|
||||||
(declare get-match)
|
(declare get-match)
|
||||||
(declare get-router)
|
(declare get-router)
|
||||||
|
|
@ -99,9 +100,9 @@
|
||||||
:compile compile-result
|
:compile compile-result
|
||||||
::default-options-endpoint default-options-endpoint}
|
::default-options-endpoint default-options-endpoint}
|
||||||
opts)]
|
opts)]
|
||||||
(assert (not (contains? opts ::default-options-handler))
|
(when (contains? opts ::default-options-handler)
|
||||||
(str "Option `" ::default-options-handler "` is deprecated."
|
(ex/fail! (str "Option :reitit.ring/default-options-handler is deprecated."
|
||||||
" Use `:" ::default-options-endpoint "` instead."))
|
" Use :reitit.ring/default-options-endpoint instead.")))
|
||||||
(r/router data opts))))
|
(r/router data opts))))
|
||||||
|
|
||||||
(defn routes
|
(defn routes
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,7 @@
|
||||||
|
|
||||||
(deftest default-options-handler-test
|
(deftest default-options-handler-test
|
||||||
(testing "Assertion fails when using deprecated options-handler"
|
(testing "Assertion fails when using deprecated options-handler"
|
||||||
(is (thrown? java.lang.AssertionError (ring/router [] {::ring/default-options-handler (fn [_])})))))
|
(is (thrown? ExceptionInfo (ring/router [] {::ring/default-options-handler (fn [_])})))))
|
||||||
|
|
||||||
(deftest default-options-endpoint-test
|
(deftest default-options-endpoint-test
|
||||||
(let [response {:status 200, :body "ok"}]
|
(let [response {:status 200, :body "ok"}]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue