Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use clojure.java.io/resource to get at resources in the classpath. Mu…

…ch nicer.
  • Loading branch information...
commit b3063c0f08828b83f78c577c2045b8e38ea0b159 1 parent e6672db
@marktriggs authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 test/net/dishevelled/test/mailindex.clj
View
12 test/net/dishevelled/test/mailindex.clj
@@ -2,6 +2,7 @@
(:require [clojure.contrib.seq :as sq])
(:import (org.apache.lucene.store RAMDirectory))
(:use clojure.test
+ clojure.java.io
net.dishevelled.mailindex))
@@ -18,12 +19,11 @@
(defn get-test-messages []
- (let [cl (-> (Thread/currentThread) .getContextClassLoader)]
- (map (fn [[n filename]]
- (with-open [msg (.getResourceAsStream cl filename)]
- {:id {:group "test" :num (str n)}
- :content (.getBytes (slurp msg) "UTF-8")}))
- (sq/indexed ["test-message-1.mbox" "test-message-with-html-attachment.mbox"]))))
+ (map (fn [[n filename]]
+ {:id {:group "test" :num (str n)}
+ :content (.getBytes (slurp (resource filename)) "UTF-8")})
+ (sq/indexed ["test-message-1.mbox"
+ "test-message-with-html-attachment.mbox"])))
(defn index-test-messages [f]
Please sign in to comment.
Something went wrong with that request. Please try again.