                                     (ns-publics ns)))))
             {} nses)))
 
-(def ^:dynamic *ns-results*)
-(def ^:dynamic *current-test*)
+(def ^{:dynamic true} *ns-results*)
+(def ^{:dynamic true} *current-test*)
+(def ^{:dynamic true} *string-writer*)
 
 (defn reset-streams! []
-  (set! *out* (StringWriter.))
+  (set! *string-writer* (StringWriter.))
+  (set! *out* (PrintWriter. *string-writer* true))
   (set! *err* *out*))
 
 (defn unprintable? [obj]

(defmulti my-report :type)

(defmethod my-report :pass [m]
  (update-results *out* (dissoc m :actual)))

(defmethod my-report :fail [m]
  (update-results *out* m))

(defmethod my-report :error [m]
  (update-results *out* (update-in m [:actual] parse-exception)))

(defmethod my-report :begin-test-var [m]
  (set! *current-test* (:name (meta (:var m))))
  (reset-streams!))

(defmethod my-report :end-test-var [m]
  (update-results *out*)
  (set! *current-test* nil))

(defn run-ns-tests [ns tests]

        [bake.reload :only [last-reloaded last-modified reload]]
        [bake.notify :only [notify]]
        [bake.clj-stacktrace])
  (:import [java.io StringWriter IOException PrintWriter]))

(defn test-vars [nses {:keys [tags functions namespaces]}]
  (let [run? (fn [ns]
