Skip to content
Browse files

Auto-fetch jar, except I can't get the right damn URI.

  • Loading branch information...
1 parent 2b05ce7 commit a495b656fc618fe2f95e299ec77e37c324506731 @amalloy amalloy committed Sep 26, 2011
Showing with 16 additions and 2 deletions.
  1. +16 −2 test/classlojure_test.clj
View
18 test/classlojure_test.clj
@@ -1,7 +1,21 @@
(ns classlojure-test
- (:use clojure.test classlojure.core))
+ (:use clojure.test classlojure.core
+ [clojure.java.io :only [copy]]))
-(def clj-13 "file:clojure-1.3.0.jar")
+(def filepath "test/clojure-1.3.0.jar")
+(def clj-13 (str "file:" filepath))
+
+(defn with-clojure-jar [f]
+ (let [file (java.io.File. filepath)]
+ (when-not (.exists file)
+ (.createNewFile file)
+ (let [out (java.io.FileOutputStream. file)
+ url "http://search.maven.org/remotecontent?filepath=org/clojure/clojure/1.3.0/clojure-1.3.0.jar" ;; horrible url, can't find canonical one. someone fix?
+ ]
+ (copy url out))))
+ (f))
+
+(use-fixtures :once with-clojure-jar)
(deftest separate-classloader
(let [cl (classlojure clj-13)]

0 comments on commit a495b65

Please sign in to comment.
Something went wrong with that request. Please try again.