Permalink
Browse files

Replaced references to ring.util.test with ring.util.io (fixes #57)

  • Loading branch information...
1 parent 86a0442 commit 18db74b0bac9e1577d21692c6d2a43446b9a69b6 @weavejester weavejester committed Mar 21, 2012
@@ -1,6 +1,6 @@
(ns ring.middleware.multipart-params.test.byte-array
(:use clojure.test
- ring.util.test
+ [ring.util.io :only (string-input-stream)]
ring.middleware.multipart-params.byte-array))
(deftest test-byte-array-store
@@ -1,6 +1,6 @@
(ns ring.middleware.multipart-params.test.temp-file
(:use clojure.test
- ring.util.test
+ [ring.util.io :only (string-input-stream)]
ring.middleware.multipart-params.temp-file))
(deftest test-temp-file-store
@@ -1,7 +1,7 @@
(ns ring.middleware.test.multipart-params
(:use clojure.test
ring.middleware.multipart-params
- ring.util.test)
+ [ring.util.io :only (string-input-stream)])
(:import java.io.InputStream))
(defn string-store [item]
@@ -1,7 +1,7 @@
(ns ring.middleware.test.params
(:use clojure.test
- ring.middleware.params)
- (:require [ring.util.test :as tu]))
+ ring.middleware.params
+ [ring.util.io :only (string-input-stream)]))
(def wrapped-echo (wrap-params identity))
@@ -15,23 +15,23 @@
(deftest wrap-params-query-and-form-params
(let [req {:query-string "foo=bar"
:content-type "application/x-www-form-urlencoded"
- :body (tu/string-input-stream "biz=bat%25")}
+ :body (string-input-stream "biz=bat%25")}
resp (wrapped-echo req)]
(is (= {"foo" "bar"} (:query-params resp)))
(is (= {"biz" "bat%"} (:form-params resp)))
(is (= {"foo" "bar" "biz" "bat%"} (:params resp)))))
(deftest wrap-params-not-form-encoded
(let [req {:content-type "application/json"
- :body (tu/string-input-stream "{foo: \"bar\"}")}
+ :body (string-input-stream "{foo: \"bar\"}")}
resp (wrapped-echo req)]
(is (empty? (:form-params resp)))
(is (empty? (:params resp)))))
(deftest wrap-params-always-assocs-maps
(let [req {:query-string ""
:content-type "application/x-www-form-urlencoded"
- :body (tu/string-input-stream "")}
+ :body (string-input-stream "")}
resp (wrapped-echo req)]
(is (= {} (:query-params resp)))
(is (= {} (:form-params resp)))
@@ -40,7 +40,7 @@
(deftest wrap-params-encoding
(let [req {:character-encoding "UTF-16"
:content-type "application/x-www-form-urlencoded"
- :body (tu/string-input-stream "hello=world" "UTF-16")}
+ :body (string-input-stream "hello=world" "UTF-16")}
resp (wrapped-echo req)]
(is (= (:params resp) {"hello" "world"}))
(is (= (:form-params resp) {"hello" "world"}))))
@@ -1,6 +1,6 @@
(ns ring.middleware.test.resource
(:use clojure.test
- ring.util.test
+ [ring.util.io :only (string-input-stream)]
ring.middleware.resource))
(defn test-handler [request]
@@ -1,12 +1,12 @@
(ns ring.handler.test.dump
(:use clojure.test
- ring.handler.dump)
- (:require [ring.util.test :as tu]))
+ [ring.util.io :only (string-input-stream)]
+ ring.handler.dump))
(def post-req
{:uri "/foo/bar"
:request-method :post
- :body (tu/string-input-stream "post body")})
+ :body (string-input-stream "post body")})
(def get-req
{:uri "/foo/bar"
@@ -1,7 +1,7 @@
(ns ring.middleware.test.lint
(:use clojure.test
+ [ring.util.io :only (string-input-stream)]
ring.middleware.lint)
- (:require [ring.util.test :as tu])
(:import (java.io File InputStream)))
(def valid-request
@@ -110,7 +110,7 @@
[nil {:foo "bar"} {"bar" :foo} {"Bar" "foo"}])
(lints-req :body
- [nil (tu/string-input-stream "thebody")]
+ [nil (string-input-stream "thebody")]
["thebody" :thebody])
@@ -123,5 +123,5 @@
[nil {:foo "bar"} {"foo" :bar} {"dir" 123}])
(lints-resp :body
- [nil "thebody" (list "foo" "bar") (tu/string-input-stream "thebody") (File. "test/ring/assets/foo.html")]
+ [nil "thebody" (list "foo" "bar") (string-input-stream "thebody") (File. "test/ring/assets/foo.html")]
[123 :thebody])

0 comments on commit 18db74b

Please sign in to comment.