diff --git a/modules/reitit-core/src/reitit/spec.cljc b/modules/reitit-core/src/reitit/spec.cljc index 5e225ee2..9568593a 100644 --- a/modules/reitit-core/src/reitit/spec.cljc +++ b/modules/reitit-core/src/reitit/spec.cljc @@ -1,7 +1,6 @@ (ns reitit.spec (:require [clojure.spec.alpha :as s] [clojure.spec.gen.alpha :as gen] - [clojure.string :as str] [reitit.core :as reitit])) ;; diff --git a/test/cljc/reitit/coercion_test.cljc b/test/cljc/reitit/coercion_test.cljc index bf33b52f..ef067497 100644 --- a/test/cljc/reitit/coercion_test.cljc +++ b/test/cljc/reitit/coercion_test.cljc @@ -48,4 +48,3 @@ (is (= nil (coercion/coerce! m)))) (let [m (r/match-by-path r "/none/kikka/abba")] (is (= nil (coercion/coerce! m)))))))) - diff --git a/test/cljc/reitit/core_test.cljc b/test/cljc/reitit/core_test.cljc index cbc1e266..1c071a8b 100644 --- a/test/cljc/reitit/core_test.cljc +++ b/test/cljc/reitit/core_test.cljc @@ -16,7 +16,7 @@ (is (= name (r/router-name router))) (is (= [["/api/ipa/:size" {:name ::beer} nil]] (r/routes router))) - (is (= true (map? (r/options router)))) + (is (map? (r/options router))) (is (= (r/map->Match {:template "/api/ipa/:size" :data {:name ::beer} @@ -39,7 +39,7 @@ :required #{:size} :params nil}) (r/match-by-name router ::beer))) - (is (= true (r/partial-match? (r/match-by-name router ::beer)))) + (is (r/partial-match? (r/match-by-name router ::beer))) (is (thrown-with-msg? ExceptionInfo #"^missing path-params for route /api/ipa/:size -> \#\{:size\}$" @@ -72,7 +72,7 @@ (is (= name (r/router-name router))) (is (= [["/api/ipa/large" {:name ::beer} nil]] (r/routes router))) - (is (= true (map? (r/options router)))) + (is (map? (r/options router))) (is (= (r/map->Match {:template "/api/ipa/large" :data {:name ::beer} diff --git a/test/cljc/reitit/ring_spec_test.cljc b/test/cljc/reitit/ring_spec_test.cljc index f730d394..69fd947b 100644 --- a/test/cljc/reitit/ring_spec_test.cljc +++ b/test/cljc/reitit/ring_spec_test.cljc @@ -12,9 +12,9 @@ (deftest route-data-validation-test (testing "validation is turned off by default" - (is (true? (r/router? - (r/router - ["/api" {:handler "identity"}]))))) + (is (r/router? + (r/router + ["/api" {:handler "identity"}])))) (testing "with default spec validates :name, :handler and :middleware" (is (thrown-with-msg? @@ -40,11 +40,11 @@ {:validate rrs/validate-spec!})))) (testing "spec can be overridden" - (is (true? (r/router? - (ring/router - ["/api" {:handler "identity"}] - {:spec (s/spec any?) - :validate rrs/validate-spec!})))) + (is (r/router? + (ring/router + ["/api" {:handler "identity"}] + {:spec (s/spec any?) + :validate rrs/validate-spec!}))) (testing "predicates are not allowed" (is (thrown-with-msg? @@ -56,15 +56,15 @@ :validate rrs/validate-spec!}))))) (testing "middleware can contribute to specs" - (is (true? (r/router? - (ring/router - ["/api" {:get {:handler identity - :roles #{:admin}}}] - {:validate rrs/validate-spec! - :data {:middleware [{:spec (s/keys :opt-un [::roles]) - :wrap (fn [handler] - (fn [request] - (handler request)))}]}})))) + (is (r/router? + (ring/router + ["/api" {:get {:handler identity + :roles #{:admin}}}] + {:validate rrs/validate-spec! + :data {:middleware [{:spec (s/keys :opt-un [::roles]) + :wrap (fn [handler] + (fn [request] + (handler request)))}]}}))) (is (thrown-with-msg? ExceptionInfo #"Invalid route data" diff --git a/test/cljc/reitit/spec_test.cljc b/test/cljc/reitit/spec_test.cljc index cd07b822..6ef967df 100644 --- a/test/cljc/reitit/spec_test.cljc +++ b/test/cljc/reitit/spec_test.cljc @@ -16,7 +16,7 @@ (testing "route-data" (are [data] - (is (= true (r/router? (r/router data)))) + (is (r/router? (r/router data))) ["/api" {}] @@ -45,12 +45,12 @@ ["/ipa"]]))) (testing "routes conform to spec (can't spec protocol functions)" - (is (= true (s/valid? ::rs/routes (r/routes (r/router ["/ping"])))))) + (is (s/valid? ::rs/routes (r/routes (r/router ["/ping"]))))) (testing "options" (are [opts] - (is (= true (r/router? (r/router ["/api"] opts)))) + (is (r/router? (r/router ["/api"] opts))) {:path "/"} {:data {}} @@ -78,8 +78,8 @@ (deftest route-data-validation-test (testing "validation is turned off by default" - (is (true? (r/router? (r/router - ["/api" {:handler "identity"}]))))) + (is (r/router? (r/router + ["/api" {:handler "identity"}])))) (testing "with default spec validates :name and :handler" (is (thrown-with-msg? @@ -96,7 +96,7 @@ {:validate rs/validate-spec!})))) (testing "spec can be overridden" - (is (true? (r/router? (r/router - ["/api" {:handler "identity"}] - {:spec any? - :validate rs/validate-spec!})))))) + (is (r/router? (r/router + ["/api" {:handler "identity"}] + {:spec any? + :validate rs/validate-spec!})))))