Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use clojure.core/slurp instead of slurp* from c.c.duck-streams or c.c…

….io.
  • Loading branch information...
commit b97bd125d95e6dad35de23e6b3689c62961f3a4a 1 parent d778ce4
@mmcgrana authored
View
5 ring-core/src/ring/middleware/params.clj
@@ -1,8 +1,7 @@
(ns ring.middleware.params
"Parse form and query params."
(:require [ring.util.codec :as codec]
- [clojure.string :as string]
- [clojure.contrib.io :as io]))
+ [clojure.string :as string]))
(defn assoc-param
"Associate a key with a value. If the key already exists in the map,
@@ -48,7 +47,7 @@
[request encoding]
(merge-with merge request
(if-let [body (and (urlencoded-form? request) (:body request))]
- (let [params (parse-params (io/slurp* body) encoding)]
+ (let [params (parse-params (slurp body) encoding)]
{:form-params params, :params params})
{:form-params {}, :params {}})))
View
8 ring-core/test/ring/middleware/multipart_params_test.clj
@@ -1,9 +1,7 @@
(ns ring.middleware.multipart-params-test
(:use clojure.test
- ring.middleware.multipart-params
- [clojure.contrib.def :only (defvar-)])
- (:require [clojure.contrib.duck-streams :as du]
- [ring.util.test :as tu])
+ ring.middleware.multipart-params)
+ (:require [ring.util.test :as tu])
(:import java.io.File))
(def ^{:private true}
@@ -35,4 +33,4 @@
(is (= 5 (:size upload)))
(is (= "text/plain" (:content-type upload)))
(is (instance? File (:tempfile upload)))
- (is (= "foo\r\n" (du/slurp* (:tempfile upload)))))))
+ (is (= "foo\r\n" (slurp (:tempfile upload)))))))
View
7 ring-core/test/ring/util/response_test.clj
@@ -1,7 +1,6 @@
(ns ring.util.response-test
(:use clojure.test
- ring.util.response
- [clojure.contrib.duck-streams :only (slurp*)]))
+ ring.util.response))
(deftest test-redirect
(is (= {:status 302 :headers {"Location" "http://google.com"} :body ""}
@@ -22,12 +21,12 @@
(let [resp (resource-response "/ring/util/response_test.clj")]
(is (= (resp :status) 200))
(is (= (resp :headers) {}))
- (is (.startsWith (slurp* (resp :body))
+ (is (.startsWith (slurp (resp :body))
"(ns ring.util.response-test"))))
(deftest test-resource-with-root
(let [resp (resource-response "response_test.clj" {:root "/ring/util"})]
- (is (.startsWith (slurp* (resp :body))
+ (is (.startsWith (slurp (resp :body))
"(ns ring.util.response-test"))))
(deftest test-missing-resource
Please sign in to comment.
Something went wrong with that request. Please try again.