From 22b427aca1e3bb93a61adb42da98d4b3ed83002b Mon Sep 17 00:00:00 2001 From: Phil Hagelberg Date: Wed, 29 Aug 2012 17:35:50 -0700 Subject: [PATCH] Fix some of the tests. --- test/leiningen/test/pom.clj | 2 +- test/leiningen/test/repl.clj | 20 ++++++++++---------- test_projects/sample/project.clj | 3 ++- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/test/leiningen/test/pom.clj b/test/leiningen/test/pom.clj index 7dec920aa..d7ac3388e 100644 --- a/test/leiningen/test/pom.clj +++ b/test/leiningen/test/pom.clj @@ -64,7 +64,7 @@ "description is included") (is (= nil (first-in xml [:project :mailingLists])) "no mailing list") - (is (= ["central" "clojars" "snapshots"] + (is (= ["central" "clojars" "other"] (map #(first-in % [:repository :id]) (deep-content xml [:project :repositories]))) "repositories are named") diff --git a/test/leiningen/test/repl.clj b/test/leiningen/test/repl.clj index e088d3796..65d035094 100644 --- a/test/leiningen/test/repl.clj +++ b/test/leiningen/test/repl.clj @@ -4,21 +4,21 @@ (deftest test-options-for-reply-empty (let [project {}] - (is (= {:attach "localhost:9876" + (is (= {:attach "127.0.0.1:9876" :custom-init nil} (options-for-reply project :attach 9876))))) (deftest test-options-for-reply-host - (let [project {:repl-options {:host "127.0.0.1"}}] - (is (= {:attach "127.0.0.1:9876" - :host "127.0.0.1" + (let [project {:repl-options {:host "192.168.0.10"}}] + (is (= {:attach "192.168.0.10:9876" + :host "192.168.0.10" :custom-init nil} (options-for-reply project :attach 9876))))) (deftest test-options-for-reply-prompt (let [prompt-fn (fn [ns] "hi ") project {:repl-options {:prompt prompt-fn}}] - (is (= {:attach "localhost:9876" + (is (= {:attach "127.0.0.1:9876" :custom-prompt prompt-fn :custom-init nil} (options-for-reply project :attach 9876))))) @@ -26,13 +26,13 @@ (deftest test-options-for-reply-init (let [init-form '(println "ohai") project {:repl-options {:init init-form}}] - (is (= {:attach "localhost:9876" + (is (= {:attach "127.0.0.1:9876" :custom-init init-form} (options-for-reply project :attach 9876))))) (deftest test-options-for-reply-init-ns (let [project {:repl-options {:init-ns 'foo.core}}] - (is (= {:attach "localhost:9876" + (is (= {:attach "127.0.0.1:9876" :init-ns 'foo.core :custom-init '(do (clojure.core/require 'foo.core) (clojure.core/in-ns 'foo.core) @@ -41,7 +41,7 @@ (deftest test-options-for-reply-init-ns-and-init (let [project {:repl-options {:init-ns 'foo.core :init '(println "ohai")}}] - (is (= {:attach "localhost:9876" + (is (= {:attach "127.0.0.1:9876" :init-ns 'foo.core :custom-init '(do (clojure.core/require 'foo.core) (clojure.core/in-ns 'foo.core) @@ -50,7 +50,7 @@ (deftest test-options-for-reply-main-ns (let [project {:main 'foo.core}] - (is (= {:attach "localhost:9876" + (is (= {:attach "127.0.0.1:9876" :custom-init '(do (clojure.core/require 'foo.core) (clojure.core/in-ns 'foo.core) nil)} @@ -58,7 +58,7 @@ (deftest test-options-for-reply-init-ns-beats-main (let [project {:main 'foo.core :repl-options {:init-ns 'winner.here}}] - (is (= {:attach "localhost:9876" + (is (= {:attach "127.0.0.1:9876" :init-ns 'winner.here :custom-init '(do (clojure.core/require 'winner.here) (clojure.core/in-ns 'winner.here) diff --git a/test_projects/sample/project.clj b/test_projects/sample/project.clj index 9aec3eee2..bb61a4dd5 100644 --- a/test_projects/sample/project.clj +++ b/test_projects/sample/project.clj @@ -23,5 +23,6 @@ :default (complement :integration) :random (fn [_] (> (rand) ~(float 1/2))) :all (constantly true)} - :deploy-repositories {"snapshots" ~(format "file://%s/lein-repo" + :repositories {"other" "http://example.com/repo"} + :deploy-repositories {"snapshots" ~(format "file://%s/lein-snapshots" (System/getProperty "java.io.tmpdir"))})