Merge pull request #157 from valerauko/fix-tests-reflection

Fix tests and reflection warnings
This commit is contained in:
Tommi Reiman 2018-10-16 20:17:38 +03:00 committed by GitHub
commit a1aee49105
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 10 deletions

View file

@ -66,9 +66,9 @@
:headers {"Content-Type" "text/plain"} :headers {"Content-Type" "text/plain"}
:body (str "Malformed " (-> e ex-data :format pr-str) " request.")}) :body (str "Malformed " (-> e ex-data :format pr-str) " request.")})
(defn wrap-log-to-console [handler e {:keys [uri request-method] :as req}] (defn wrap-log-to-console [handler ^Throwable e {:keys [uri request-method] :as req}]
(print! *out* (Instant/now) request-method (pr-str uri) "=>" (.getMessage e)) (print! *out* (Instant/now) request-method (pr-str uri) "=>" (.getMessage e))
(.printStackTrace e *out*) (.printStackTrace e ^PrintWriter *out*)
(handler e req)) (handler e req))
;; ;;

View file

@ -86,9 +86,9 @@
:headers {"Content-Type" "text/plain"} :headers {"Content-Type" "text/plain"}
:body (str "Malformed " (-> e ex-data :format pr-str) " request.")}) :body (str "Malformed " (-> e ex-data :format pr-str) " request.")})
(defn wrap-log-to-console [handler e {:keys [uri request-method] :as req}] (defn wrap-log-to-console [handler ^Throwable e {:keys [uri request-method] :as req}]
(print! *out* (Instant/now) request-method (pr-str uri) "=>" (.getMessage e)) (print! *out* (Instant/now) request-method (pr-str uri) "=>" (.getMessage e))
(.printStackTrace e *out*) (.printStackTrace e ^PrintWriter *out*)
(handler e req)) (handler e req))
;; ;;

View file

@ -99,9 +99,7 @@
:coercion reitit.coercion.spec/coercion} :coercion reitit.coercion.spec/coercion}
:validate rrs/validate-spec!}))) :validate rrs/validate-spec!})))
(is (thrown-with-msg? (is (r/router?
ExceptionInfo
#"Invalid route data"
(ring/router (ring/router
["/api" ["/api"
["/plus/:e" ["/plus/:e"

View file

@ -116,9 +116,9 @@
:header {:d string?} :header {:d string?}
:path {:e string?}}})) :path {:e string?}}}))
(is (not (s/valid? (is (s/valid?
::rs/parameters ::rs/parameters
{:parameters {:header {"d" string?}}}))) {:parameters {:header {"d" string?}}}))
(is (s/valid? (is (s/valid?
::rs/responses ::rs/responses