diff --git a/modules/reitit-ring/src/reitit/ring.cljc b/modules/reitit-ring/src/reitit/ring.cljc index 3585caf8..c408d891 100644 --- a/modules/reitit-ring/src/reitit/ring.cljc +++ b/modules/reitit-ring/src/reitit/ring.cljc @@ -100,7 +100,9 @@ ::default-options-endpoint default-options-endpoint} opts)] (assert (not (contains? opts ::default-options-handler)) - "Option `::default-options-handler` is deprecated. Use `::default-options-endpoint` instead.") + (str + "Option `:reitit.ring/default-options-handler` is deprecated." + " Use `:reitit.ring/default-options-endpoint` instead.")) (r/router data opts)))) (defn routes diff --git a/test/cljc/reitit/ring_test.cljc b/test/cljc/reitit/ring_test.cljc index 4a5ecbb4..cdb919f9 100644 --- a/test/cljc/reitit/ring_test.cljc +++ b/test/cljc/reitit/ring_test.cljc @@ -205,6 +205,10 @@ (is (= 405 (:status (app {:request-method :post, :uri "/ping"})))))))))) (deftest default-options-handler-test + (testing "Assertion fails when using deprecated options-handler" + (is (thrown? java.lang.AssertionError (ring/router [] {::ring/default-options-handler (fn [_] )}))))) + +(deftest default-options-endpoint-test (let [response {:status 200, :body "ok"}] (testing "with defaults"