Permalink
Browse files

Added test for in-ns dependencies

  • Loading branch information...
1 parent e35c606 commit 7f8d9f9b3a44175a3d4b4d709af7d74f99180cbc @weavejester committed Feb 2, 2013
Showing with 13 additions and 0 deletions.
  1. +13 −0 test/ns_tracker/test/core.clj
@@ -6,6 +6,7 @@
(deftest test-ns-tracker
(.mkdirs (file "tmp/example"))
+ (.mkdirs (file "tmp/example/internal"))
(try
(let [modified-namespaces (ns-tracker [(file "tmp")])]
(testing "modified files are reloaded"
@@ -24,6 +25,18 @@
(spit (file "tmp/example/util.clj") '(ns example.util))
(is (= (modified-namespaces) '(example.util example.core))))
+ (testing "can handle in-ns forms"
+ (Thread/sleep 1000)
+ (spit (file "tmp/example/internal/util.clj") '(in-ns example.util))
+ (spit (file "tmp/example/util.clj")
+ (pr-str '(ns example.util) '(load "example/internal/util")))
+ (spit (file "tmp/example/core.clj")
+ '(ns example.core (:use example.util)))
+ (modified-namespaces)
+ (Thread/sleep 1000)
+ (spit (file "tmp/example/internal/util.clj") '(in-ns example.util))
+ (is (= (modified-namespaces) '(example.util example.core))))
+
(testing "namespaces are returned in an order suited for reloading"
(Thread/sleep 1000)
(spit (file "tmp/example/a.clj") '(ns example.a))

0 comments on commit 7f8d9f9

Please sign in to comment.