Skip to content

Commit

Permalink
Fix some of the tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
technomancy committed Aug 30, 2012
1 parent a2d2b92 commit 22b427a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion test/leiningen/test/pom.clj
Expand Up @@ -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")
Expand Down
20 changes: 10 additions & 10 deletions test/leiningen/test/repl.clj
Expand Up @@ -4,35 +4,35 @@

(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)))))

(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)
Expand All @@ -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)
Expand All @@ -50,15 +50,15 @@

(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)}
(options-for-reply project :attach 9876)))))

(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)
Expand Down
3 changes: 2 additions & 1 deletion test_projects/sample/project.clj
Expand Up @@ -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"))})

0 comments on commit 22b427a

Please sign in to comment.