Permalink
Browse files

Fix repl tests.

  • Loading branch information...
1 parent d23d929 commit b5dc41a6822a44a058954677c1cc2612cfcdb67b @technomancy committed Oct 4, 2012
Showing with 21 additions and 10 deletions.
  1. +21 −10 test/leiningen/test/repl.clj
@@ -1,33 +1,40 @@
(ns leiningen.test.repl
- (:use [clojure.test]
- [leiningen.repl]))
+ (:require [clojure.test :refer :all]
+ [leiningen.repl :refer :all]
+ [leiningen.core.user :as user]))
+
+(def history-file (str (user/leiningen-home) "/repl-history"))
(deftest test-options-for-reply-empty
(let [project {}]
(is (= {:attach "127.0.0.1:9876"
- :custom-init nil}
+ :custom-init nil
+ :history-file history-file}
(options-for-reply project :attach 9876)))))
(deftest test-options-for-reply-host
(let [project {:repl-options {:host "192.168.0.10"}}]
(is (= {:attach "192.168.0.10:9876"
:host "192.168.0.10"
- :custom-init nil}
+ :custom-init nil
+ :history-file history-file}
(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 "127.0.0.1:9876"
:custom-prompt prompt-fn
- :custom-init nil}
+ :custom-init nil
+ :history-file history-file}
(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 "127.0.0.1:9876"
- :custom-init init-form}
+ :custom-init init-form
+ :history-file history-file}
(options-for-reply project :attach 9876)))))
(deftest test-options-for-reply-init-ns
@@ -36,7 +43,8 @@
:init-ns 'foo.core
:custom-init '(do (clojure.core/require 'foo.core)
(clojure.core/in-ns 'foo.core)
- nil)}
+ nil)
+ :history-file history-file}
(options-for-reply project :attach 9876)))))
(deftest test-options-for-reply-init-ns-and-init
@@ -45,15 +53,17 @@
:init-ns 'foo.core
:custom-init '(do (clojure.core/require 'foo.core)
(clojure.core/in-ns 'foo.core)
- (println "ohai"))}
+ (println "ohai"))
+ :history-file history-file}
(options-for-reply project :attach 9876)))))
(deftest test-options-for-reply-main-ns
(let [project {:main 'foo.core}]
(is (= {:attach "127.0.0.1:9876"
:custom-init '(do (clojure.core/require 'foo.core)
(clojure.core/in-ns 'foo.core)
- nil)}
+ nil)
+ :history-file history-file}
(options-for-reply project :attach 9876)))))
(deftest test-options-for-reply-init-ns-beats-main
@@ -62,6 +72,7 @@
:init-ns 'winner.here
:custom-init '(do (clojure.core/require 'winner.here)
(clojure.core/in-ns 'winner.here)
- nil)}
+ nil)
+ :history-file history-file}
(options-for-reply project :attach 9876)))))

0 comments on commit b5dc41a

Please sign in to comment.