Permalink
Browse files

add test for in-project

  • Loading branch information...
ninjudd committed Nov 20, 2012
1 parent 4bda46d commit 59b3c2a485689a67a4564dad26deef51474ae698
Showing with 11 additions and 6 deletions.
  1. +11 −6 test-project/test/leinjacker/eval_test.clj
@@ -14,6 +14,11 @@
'(spit ".test-output" (System/getenv "LEIN_VERSION")))
(str (first (slurp ".test-output"))) => (.toString lein-gen))
+ (fact "in-project should work."
+ (in-project (utils/read-lein-project) [version (System/getenv "LEIN_VERSION")]
+ (spit ".test-output" version))
+ (str (first (slurp ".test-output"))) => (.toString lein-gen))
+
(fact "deprecated eval-in-project should work."
(dep-eip/eval-in-project
(utils/read-lein-project)
@@ -23,13 +28,13 @@
(fact "sh should work."
(sh "./bin/sh-test" ".test-output" "success")
(slurp ".test-output") => "success")
-
- ;This test should be last since it hooks eip and doesn't clean up
+
+ ;This test should be last since it hooks eip and doesn't clean up
(fact "we should be able to hook eval-in-project"
(let [my-form '(do
(in-ns 'foo.bar)
(spit ".test-output" (with-out-str
- ((resolve 'pprint) "success"))))
+ ((resolve 'pprint) "success"))))
ran-form (atom nil)]
(hook-eval-in-project
(fn [original-eip project form init]
@@ -41,6 +46,6 @@
'(do (let [old-ns *ns*]
(ns foo.bar)
(clojure.core/use 'clojure.pprint)
- (in-ns (symbol (ns-name old-ns))))))
- @ran-form => my-form
- (slurp ".test-output") => "\"success\"\n")))
+ (in-ns (symbol (ns-name old-ns))))))
+ @ran-form => my-form
+ (slurp ".test-output") => "\"success\"\n")))

0 comments on commit 59b3c2a

Please sign in to comment.